Fix add similar issue for iOS - #1152
Open
jordanstreiff wants to merge 1 commit into
Open
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
wbazant
self-requested a review
July 25, 2026 08:10
wbazant
reviewed
Jul 25, 2026
wbazant
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for looking into this! Looks plausible, I think I also found a web repro - pull down the drawer and immediately press 'Add similar'. I'll build locally and check later when i have computer time. Happy to merge just after removing the explanatory comments but to maybe make this even better:
- Does changing the ConnectNewLocation effect array by itself fix the race condition on iOS?
- for the case when location ID changed to nothing (someone closed the drawer) and the toast is going away, maybe disable the button instead?
| } | ||
| }, [dispatch, locationId, hasInitialView, isDesktop]) //eslint-disable-line | ||
| /* | ||
| * Mount-only: after a successful submit, locationId changes from 'new' to |
Collaborator
There was a problem hiding this comment.
The comment helped me understand how the change worked, thanks! I'm trying to keep the codebase relatively comment free. Can we take it out before merging? Maybe see if the doc in connectRoutes.js needs revising.
| * The location captured when the success toast was created. Restore it | ||
| * in case something (e.g. the mobile drawer closing through /map) | ||
| * cleared the slice before the user tapped 'Add similar'. | ||
| */ |
Collaborator
There was a problem hiding this comment.
Would you check if changing the effect array in ConnectNewLocation is enough? This might not be necessary.
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.
Was able to reproduce the bug on my iPhone and simulator.
When user submits the location state was getting wiped because the effect was being rerun, which forces a refetch. If the data hasn't already been populated the blank state becomes the new state. So it's a race condition that could potentially effect more than iOS.
Fix tested / works in simulator.
Closes #1143