Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
refactor(send_queue): generalize SentRequestKey::Media and DependentQueuedRequestKind::UploadFileWithThumbnail to prepare for MSC4274 gallery uploads #4897
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
refactor(send_queue): generalize SentRequestKey::Media and DependentQueuedRequestKind::UploadFileWithThumbnail to prepare for MSC4274 gallery uploads #4897
Changes from all commits
ad72a6d
c97f8f8
88d7f18
fb61003
8888ee8
2ab77d4
4a9ef07
de711e8
3206a05
8bbee70
e2511d9
7bb3335
ee947c6
cc5f655
4202377
4272eae
4ac07d5
9257a0c
773d928
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
There might be a different possible data scheme here, if I understand correctly:
SentMediaInfo
contains only the vec ofAccumulatedSentMediaInfo
(since a vec can hold the pair for the media, when there's only a single one and no gallery)AccumulatedSentMediaInfo
(maybe renameSingleSentMediaInfo
?) can keep on holding its current fields.Again, I see this struct
SentMediaInfo
is also marked asSerialized/Deserialize
, so maybe what I'm suggesting implies having to a data migration 🥴.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.
I think technically this would work, yes. I didn't go for it originally because I wanted to minimize breaking changes and because it felt slightly cleaner to have
accumulated
only contain the requests that are actually finished. This way, we only push toaccumulated
. If we do it the other way around, we'll need to push or modify the last item depending on what the request is for. Did you have specific advantages of using this variant in mind?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.
The only advantage is technical, in that it avoids containing what's effectively another flattened
AccumulatedSentMediaInfo
next to theaccumulated
vector, and also reduces the number of concepts.I'm a bit torn, because this is likely a non-trivial change, but on the other hand that might be a nice simplification. Maybe that could be attempted as a follow-up, and we could open an issue to not forget about it?
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.
Yeah, I see the oddness. Sounds good on the issue. I have opened: #4969