Repository navigation
fix: v3 fixes found while syncing main - #1792
Conversation
|
The following capabilities are marked
The following capabilities are marked
These may have been renamed, removed, or never registered. Please update the capability matrix. |
grdsdev
left a comment
There was a problem hiding this comment.
Code review findings. Some findings are on lines outside the diff, so I put them here.
1. presence.py:169: break in the leaves loop skips the remaining keys.
In _sync_diff, a leave for a key with no current presences does break, not continue. Every later key in the same diff is not processed. Example: a presence_diff has leaves for a and b, and a is unknown locally (this is the same ordering race this PR fixes for joins). The loop stops at a. The presences of b stay in self.state, and no PresenceLeave fires for b.
2. presence.py:183: leaves are still reported for presences that are already gone.
The join path now ignores known refs, but the leave path still yields PresenceLeave with all left_presences, even when none of those refs are in the state. Example: presence_state arrives without presence A, then the matching presence_diff leave for A arrives. The key still has other presences, so the leave fires a second time. Suggestion: filter left_presences to refs in current_presences, and skip the event when the list is empty.
3. presence.py:122: the join filter in _sync_state is now redundant.
_sync_diff now filters joins against the current refs. _sync_state can pass the new_state entries as joins and compute only the leaves. Then the ref-set logic is in one place.
4. PR title: the package scope is missing.
AGENTS.md says: "Commit and PR title: type(<pkg>): lowercase subject". The title fix: v3 fixes found while syncing main has no scope. With a squash merge, release-please cannot assign the commit to a package. Suggestion: merge with a rebase to keep the scoped commits, or split per package.
811393d to
905a9ca
Compare
905a9ca to
78c869d
Compare
fake.email() draws from a limited pool of names, so two tests could sign up with the same address against the shared GoTrue database and fail with "User already registered". The async and sync conftests now share one Faker instance and use fake.unique.email(), which never repeats an address within a test run.
send() removes its ref even when it is cancelled, so a reply that arrives after a timeout is dropped instead of reaching the channel stream. Presence leaves for refs that are already gone are not reported, and the remaining leave keys are still processed.
Joined presences are appended after the current ones, as in realtime-js. The orphan reply test now also checks that the listen loop kept running.
78c869d to
1f4c10a
Compare
## Why Storage analytics users who install `storage3[iceberg]` cannot load an existing table because the extra omits the backend selected by `catalog()`. Closes #1872. ## What changed - Request PyIceberg's `pyarrow` extra in the Iceberg extra and existing mypy group. - Add public async and generated sync table-load regressions with valid Iceberg REST responses. Only HTTP is mocked. - Refresh locked Pydantic from 2.12.2 to 2.12.3 so the existing PyIceberg 0.10 can parse table metadata. That patch [reverts an upstream validator regression](https://github.com/pydantic/pydantic/releases/tag/v2.12.3). ## Scope This fixes the Storage Iceberg installation. Backend selection and public APIs retain their existing behavior. #1513 and #1792 address optional imports rather than backend completeness. ## Tradeoffs Arrow adds binary wheels to the opt-in extra. A base Storage installation still imports without PyIceberg or Arrow. ## Blast radius The shared lock has no other existing package version changes. Auth and PostgREST response-parsing controls pass with the Pydantic patch. ## Verification - Both new tests fail on unchanged upstream with missing FileIO. Fresh fixed-wheel installations pass both tests and the localhost HTTP reproduction on Python 3.9 and 3.11. - Frozen Storage selection passes 82 tests. Mypy, Ruff, format, sync generation, build, lock checks, and diff checks pass. CI-pinned uv 0.8.2 executes both regressions after mypy without an extra argument. - Full Storage service tests are unverified. Isolated Supabase CLI startup fails before services start because Docker image blobs return input/output errors. AI-assisted contribution. Reproductions and checks were run locally.
Merge with "Rebase and merge", not squash. The commits touch four packages and each has its own
type(<pkg>)scope. Release-please needs those scopes to assign the changes to the right package, and a squash would collapse them into one unscoped commit.Fixes for v3 problems found while syncing main. None of them come from a main commit.
phx_closewith the join ref after a leave.listen()raisedKeyErroron it and the connection died, so all realtime integration tests failed.presence_statearriving before the matchingpresence_diffreported the same join twice.fake.email()could return the same address twice, so a sign-up failed with "User already registered". The async and sync conftests now share one Faker instance and usefake.unique.email().pyicebergwas imported at module level again, soimport storage3failed without theicebergextra. That undid d16cfc0.Review fixes
send()removes its ref even when it is cancelled, and replies nobody waits on are dropped instead of reaching the channel stream.test_unknown_refs.pycovers this with a fake server._sync_statenow relies on_sync_difffor the join filtering.test_optional_iceberg.pyfails ifimport storage3needspyicebergagain.Commits
Stack
This replaces #1789: main's changes since 6f522d3 are cherry-picked onto v3 one package at a time, so each part can be reviewed on its own. Merge from the bottom up.