Comments (10)
What is the use-case ?
from kinto-attachment.
The first use case is for Fennec OTA where we do not want the base_url in records but we want it in the Hello page. Related to Bug 1257882
from kinto-attachment.
I'm not sure it should be the default behaviour, though: it seems easier to have the complete URL of the attachment in the record (no additional operation on the client side, everything can be done with one request).
from kinto-attachment.
The reason why I was suggesting it to be the default behavior is to solve the #24 issue which make it complicated to change the base_url with existing records.
from kinto-attachment.
I understand, thanks for pointing that out.
I would prefer to stick with the full URL in the records and for instance a script which updates all the records in case the base_url
is updated, as I believe it's a good thing to focus on ease of use of our APIs rather than one-time processes like the change of a setting.
Such script would iterate over all the records in the database, looking for the attachment.location
key, and would substitute the old value with the new one.
Would that solve your problem?
from kinto-attachment.
I would prefer to stick with the full URL in the records and for instance a script which updates all the records in case the base_url is updated, as I believe it's a good thing to focus on ease of use of our APIs rather than one-time processes like the change of a setting.
The problem with that is that you will update the last_modified value of records where the data didn't changed except in the case where the url is actually the data you want to be notified about.
But in most cases you only want to update the record if the file data changed. That's at least the case in the Fennec OTA case.
In any case if we can handle both cases with the configuration it doesn't matter to me which one is the default one. I genuinely though that people that need to have the full url will know it and that people that are fine with both we be less likely to encounter the base_url update problem.
from kinto-attachment.
So we would have two scenarii when want to update the base_url
:
- You set
prepend_base_url=True
(default) in the configuration: a script can iterate on records and update their values andlast_modified
field; - You set
prepend_base_url=False
, you need to tell your client to change thebase_url
. I'm not sure how you detect this on the client side and what should be done then.
Note that I'm not advocating against the idea of removing the base_url
from the records. I think it's a good thing to do in some cases. I just thing that this shouldn't be the default behaviour.
from kinto-attachment.
Also, this configuration should be exposed in the root URL and checked by the clients, otherwise they might fail without notice on configuration /server change.
It might also be a good idea to have this option setup by collection/bucket rather than having it server-wide.
from kinto-attachment.
It might also be a good idea to have this option setup by collection/bucket rather than having it server-wide.
It can also be configured server-wide by bucket/collection as for kinto-signer.
However I don't see how it could be configured client-side because the server is responsible for putting the data there. So it should be the source of truth that tells where it puts the data.
from kinto-attachment.
I don't see how it could be configured client-side
That's not my proposal :) I was more proposing a configuration per collection, either in the configuration (like what we did for the signer) or in the bucket's data.
from kinto-attachment.
Related Issues (20)
- Plugin doesn't work with request validation HOT 1
- current_resource_name must be defined before instantiating a record resource
- Do not use `any` as default allowed extensions
- Add GZIP encoded S3 support HOT 1
- Do not use underscore as separator for use_content_encoding setting
- Do not delete attachment with record if keep_old_files is true
- Simplify compression options
- S3ResponseError: 403 Forbidden SignatureDoesNotMatch HOT 1
- Simplify S3 upload - remove Gzip encoding HOT 1
- Heartbeat does not use same storing method as views
- Heartbeat breaks on file not allowed
- Cannot delete record attachment ? HOT 5
- 10 seconds timeout (Connection reset) instead of 403
- Failing tests: Invalid boundary in multipart form: b'' HOT 6
- support for google cloud storage HOT 4
- Refactor utils hacks
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- Document release process to PyPI HOT 2
- Update main branch from master to main HOT 1
- Cannot delete attachment `"attachment in body: None is not of type 'object'"`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kinto-attachment.