✨ QRESYNC: Add vanished keyword to #uid_fetch
#519
+107
−17
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.
The
vanishedkwarg to#uid_fetchcan be used to request a list all of the message UIDs insetthat have been expunged sincechangedsince. Settingvanishedto true prepends aVanishedDataobject to the returned array. If the server does not return aVANISHEDresponse, an emptyVanishedDataobject will still be added.For example:
The
QRESYNCcapabability must be enabled. RFC7162Alternatives for return type
This PR chose to prepend a
VanishedDataobject to the returned array. Because it only does this when thevanished: truekwarg is sent, it should be fully backward compatible. Other API choices were considered:[vanished, fetched_array]. I strongly prefer a flat array of responses ([vanished, *fetched_array]). IMO, it's more consistent with the original API, and just as easy to work with.FetchResulttype, with a#vanishedmethod.SearchResult. That was done to minimize any backward compatibility issues. Also, there's no simple way to distinguish between a modseq integer and a UID or sequence number. But I'd prefer not to subclass Array.vanished. I'd prefer to always returnFetchResultaccording to afetch_resultconfig option. And that wouldn't be backward compatible enough to enable by default for the next release.