-
Notifications
You must be signed in to change notification settings - Fork 380
feat: feed legacy payload param #5163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: nugaon <nugaon1@gmail.com>
acha-bill
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
pkg/api/bzz_test.go
Outdated
| ) | ||
| } | ||
|
|
||
| // func toLegacyChunk(t *testing.T, at uint64, payload []byte) swarm.Chunk { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused
janos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is a user facing feature, what would happen when the current feed structure becomes legacy. Since the structure can be changed and it is something that users interfere with over the api, I would suggest to have versioning on the feed, at least for api options (header in this case).
|
the current feed usage wraps the root chunk of the referred content so there is no specific structure in the feed payload. there is no proposal now to change the arbitrary legacy feed structure but if that's the case in the future, API could be versioned with that change as you mentioned - except the header part since it has problematic use-case #5157. maybe instead of a boolean, a version number can be used. but at the moment, I don't see why it would be necessary since there is only one version of structure of legacy feeds and most probably there won't be new one. |
Exactly, instead of boolean, a version would make changes in the future much easier. With the boolean, a transition to some new header would be needed. In general, we do not know how things will change in the future, but we can prepare to handle changes. Since the change already happened creating legacy feeds, it is possible to have another change in the future. |
|
IMHO starting to version a legacy feature is futile and makes the code and the documentation more complex. |
OK, as you wish, my opinion is different as described. We will handle the backward incompatible changes later, if they appear for this cli flag. |
|
If we use something like Other than that, the rest of the changes in the PR look great to me |
|
@gacevicljubisa the problem is the same from my perspective. also, just imagine you need to remember of the query name AND the "legacy" as well. if I needed to choose from any one them I would go with the simple versioning since that is simpler from this aspect. |
I agree it adds a little more complexity, but either way, it's another custom parameter that users will have to look up in the documentation. Since they'll be checking the docs regardless, I think the small extra step of typing But if you insist, we can go with the current approach. |
This PR adds support for legacy feed payload resolution via a new query parameter
swarm-feed-legacy-resolve. It allows clients to specify whether feed payloads should be handled using the legacy format or the newer format.This change allows for better compatibility with different feed payload formats while making legacy resolution behavior explicit rather than implicit. It still defaults on wrapping root chunk of data.
Resolves #5155 #5156 #5157
Checklist
Description
Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
Screenshots (if appropriate):