Skip to content
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

Make search working on flagship #2261

Merged
merged 3 commits into from
Jan 28, 2025
Merged

Make search working on flagship #2261

merged 3 commits into from
Jan 28, 2025

Conversation

paultranvan
Copy link
Contributor

@paultranvan paultranvan commented Jan 27, 2025

### ✨ Features

* Make search working on flagship app

### πŸ› Bug Fixes

* Prevent infinite loop at startup when query fails

### πŸ”§ Tech

*

Comment on lines 33 to 39
if (component) {
component.displayed
? component.onDisplayed()
: component.onNotDisplayed()
}
})
}, [appHighlightAlerts])
}
Copy link
Member

@Ldoppea Ldoppea Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling methods in React components but outside of a hook is considered a bad practice (those methods would be called on every rerender).

Seems like the fix here is on the added if. Would it work if keep this if but don't remove the useEffect()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, fixed

At startup we check some "app highlights" status, typicallky for backup
or geolocation tracking.
In the tracking case, we need to query the database in order to check if
there is some geolocation data.
This query might fail in offline if the local database is not ready.

And this failure was causing an infinite loop, because a retry was made
for each failed query.
@paultranvan paultranvan merged commit 3ab5b26 into feat/offline Jan 28, 2025
1 check failed
@paultranvan paultranvan deleted the offline-paul branch January 28, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants