Skip to content

test: add test to reproduce single page queue full - #141

Merged
diondokter merged 3 commits into
tweedegolf:masterfrom
lulf:single-page-queue-issue
Oct 1, 2026
Merged

diondokter merged 3 commits into
tweedegolf:masterfrom
lulf:single-page-queue-issue

Conversation

@lulf

@lulf lulf commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Feel free to close this if it's the expected behavior. But we ran into this issue where if you use a single page for a queue, where you push and pop with overwrite = false, you will eventually get stuck in StorageFull.

Disclosure: I used AI to reproduce this issue, but simplified the test case to the one in this PR.

Also, AI proposed a fix, which involes changing this piece of code to pass PageState::Closed instead of next_page_state if it's a single page.

                    if !allow_overwrite_old_data
                        && !self
                            .inner
                            .is_page_empty(next_page, Some(next_page_state))
                            .await?
                    {
                        self.inner.cache.unmark_dirty();
                        return Err(Error::FullStorage);
                    }

@lulf
lulf force-pushed the single-page-queue-issue branch from e37bf1a to b6c5df7 Compare October 1, 2026 08:33
@diondokter

diondokter commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Cool! Implemented the fix. Didn't like the AI suggestion. Instead I factored out the part of the function we actually want to call instead of providing a false state

@diondokter
diondokter merged commit c65cba7 into tweedegolf:master Oct 1, 2026
5 checks passed
@diondokter

Copy link
Copy Markdown
Member

Released as 8.0.2

@lulf

lulf commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Great, thanks @diondokter !

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