Repository navigation
fix(groups): keep the picture on the form through the success hold - #1507
Merged
Merged
Conversation
Creating a public group with a picture showed the tile crossfade back to the empty camera icon a beat before the flow left for the chat, so the pick read as dropped at the moment it was accepted. The create's success path called discardPendingImage(), which deletes the re-encoded cache file and dispatches OnImageCleared. Navigation does not happen on that frame: dispatchSuccessThen holds the checkmark for 500ms before firing ChatCreated, and the form is on screen for all of it with its image state already reset. PhotoSelectionViewModel, which this view model's own documentation says it mirrors, leaves the pick alone on success and lets onCleared() delete the file. CreateGroupViewModel had that same onCleared() override as well as the inline call, so dropping the inline call is enough. The shared view model clears when the flow entry pops, and leaving state.image populated is what lets that cleanup find the uri. The failure paths that should drop the picture are untouched, since there the form stays on screen and the pick does have to go.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Creating a public group with a picture showed the tile crossfade back to the empty camera icon a beat before the flow left for the chat, so the pick read as dropped at the moment it was accepted.
The create's success path called
discardPendingImage(), which deletes the re-encoded cache file and dispatchesOnImageCleared. Navigation does not happen on that frame:dispatchSuccessThenholds the checkmark for 500ms before firingChatCreated, and the form is on screen for all of it with its image state already reset. The tile is wrapped in aCrossfade, so the picture faded out rather than cutting.PhotoSelectionViewModel, which this view model's own documentation says it mirrors, leaves the pick alone on success and letsonCleared()delete the file.CreateGroupViewModelhad that sameonCleared()override as well as the inline call, so dropping the inline call is enough. The shared view model clears when the flow entry pops, and leavingstate.imagepopulated is what lets that cleanup find the uri.The failure paths that should drop the picture are untouched, since there the form stays on screen and the pick does have to go.
A regression test advances to the middle of the success hold and asserts that both the picture and its cache file are still there. It failed before the change with
expected:<Uri(#65)> but was:<null>.