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: #972 next-slide-id fails when max used #994

Merged
merged 1 commit into from
Aug 3, 2024

Conversation

scanny
Copy link
Owner

@scanny scanny commented Aug 3, 2024

Summary
Naive "max + 1" slide-id allocation algorithm assumed that slide-ids were assigned from bottom up. Apparently some client assigns slide ids from the top (2,147,483,647) down and the naive algorithm would assign an invalid slide-id in that case.

Detect when the assigned id is out-of-range and fall-back to a robust algorithm for assigning a valid id based on a "first unused starting at bottom" policy.

Fixes: #972

#972

Naive "max + 1" slide-id allocation algorithm assumed that slide-ids
were assigned from bottom up. Apparently some client assigns slide ids
from the top (2,147,483,647) down and the naive algorithm would assign
an invalid slide-id in that case.

Detect when the assigned id is out-of-range and fall-back to a robust
algorithm for assigning a valid id based on a "first unused starting at
bottom" policy.
@scanny scanny merged commit 799b214 into master Aug 3, 2024
4 checks passed
@scanny scanny deleted the scanny/fix-next-slide-id branch August 3, 2024 05:12
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.

ValueError: value must be in range 256 to 2147483647 inclusive, got 2147483648 - when adding slide
1 participant