8000 fix: handle some dimensions race conditions (VO-264) by acezard · Pull Request #1151 · cozy/cozy-flagship-app · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: handle some dimensions race conditions (VO-264) #1151

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

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

acezard
Copy link
Contributor
@acezard acezard commented Jan 30, 2024

This will use the hook return values if possible, otherwise use 24px as default height on Android.
This will remove cases where the dimensions were wrongfully set at the start of the app to be 0, resulting in overlap in statusbar and application
This PR also ensures all getDimensions() call that were at the module level are now moved into the application lifecycle

@acezard acezard changed the title temp: Update getDimensions() result from hook (VO-264) fix: handle some dimensions race conditions (VO-264) Jan 30, 2024
This can fix race conditions where the height is 0.
In practice, it's not supposed to ever be under 24
@acezard acezard force-pushed the fix--handle-dimensions-dynamically branch from 5ae219e to 1a0d0df Compare January 30, 2024 09:38
@zatteo
Copy link
Member
zatteo commented Jan 31, 2024

nit: First commit start with temp:

@zatteo
Copy link
Member
zatteo commented Jan 31, 2024

I do not understand what is the fixed race condition ?

edit: Just read the issue on Linear. Understood.
nit: Maybe you can add more contexts in commit message.

This will avoid the function being called at import time
Meaning it should now always be called at function/component runtime,
so the race conditions where getDimensions is called before
the dimensions are computed by the native lib are removed
@acezard acezard merged commit 60c2801 into master Jan 31, 2024
@acezard acezard deleted the fix--handle-dimensions-dynamically branch January 31, 2024 14:55
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.

3 participants
0