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

fix: vehicle becoming permanently locked #141

Merged
merged 1 commit into from
Oct 1, 2024
Merged

Conversation

Manason
Copy link
Contributor

@Manason Manason commented Oct 1, 2024

Was able to reproduce a state where the statebag value would not match the client's setting for the vehicle lock state by having two clients both unlocking/locking the same vehicle at the same time. This resulted in a deadlock, where the native state was locked, but the statebag was set to locked, so the client attempted to toggle the state to locked. Since the state was already locked, this resulted in a no-op and the vehicle could not be unlocked.

This PR fixes this issue by checking on the client if the statebag is out of sync with the native and correcting the client to be set to the statebag before doing toggle logic. This is done when the client toggles the locks of the vehicle.

@Manason Manason requested a review from mafewtm October 1, 2024 07:12
Copy link

@FjamZoo FjamZoo left a comment

Choose a reason for hiding this comment

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

LGTM

@Manason Manason merged commit a5c1791 into main Oct 1, 2024
4 checks passed
@Manason Manason deleted the fix-statebag-sync branch October 1, 2024 07:32
@Manason Manason restored the fix-statebag-sync branch October 1, 2024 07:54
@Manason Manason deleted the fix-statebag-sync branch October 1, 2024 07:54
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