Repository navigation
A duplicated page shows its original's pictures, so a served picture isn't uploaded again - #1027
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…for the strategy's pages, as the app's page made here does, so duplicating a page with a served picture queues no upload; the offline pages run checks no upload toast and settles at the end
…the same stored rows draw the same facts before and after a reopen
SunkenInTime
force-pushed
the
t3/store-copy-pictures
branch
from
November 30, 2026 14:38
fd6cac4 to
fcaa834
Compare
1 of 15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a store-owned strategy, duplicating a page that holds a picture the server already serves no longer uploads that picture again. Offline, "Uploading image..." used to stay on screen; now no toast appears and the copy draws the picture.
Cause
_contentOfincloud_store.dartansweredContentShown()with no pictures for a page known only from itsPageAddOp, meaning a page made here that hasn't been read yet.storePageOfturned that into an emptyassetsByIdnext to elements that place the picture.reconcilePageMediathen queued an upload for each placed picture that had no active asset and whose bytes were on the device. Offline, that job stayed in the queue and the toast stayed up. Online, the bytes went up again.Fix
In
_contentOf's second arm, a page made here and not yet read now shows every picture the store holds for this strategy's pages (loaded.disk.pictures). The shipped path's_pageMadeHerealready does this ("a copy shows its original's"). Once the page is read, its own stored pictures are the answer, as before. The first arm, the reconcile and the toast are unchanged. The package README says so.If two pages hold the same picture id with different facts, the shipped path lets the page on screen win. The store doesn't know which page is on screen, so it merges in sorted page-digest order: the page under the greater digest wins. The choice depends only on the stored rows, so the same stored state draws the same facts before and after a reopen. Nothing says the page with the greater digest has the newer facts. The facts only differ if the server changed that picture between two page reads.
Tests
test/library_store/store_canvas_commit_test.dart: "duplicating a served picture offline leaves the upload queue empty" (Astra's). On main:Expected: empty / Actual: ['already-served'].packages/icarus_library/test/cloud_store_pictures_role_test.dart:Expected: {'p1': ...} / Actual: {}.Expected: {'p1': ...} / Actual: {}.Expected: {'p1': Instance of 'PictureAsset'} / Actual: {'p1': Instance of 'PictureAsset'} / Which: at location ['p1'] is <Instance of 'PictureAsset'> instead of <Instance of 'PictureAsset'>.The store model (
cloud_store_model_test.dart) does not readcontent.pictures. It reads elements, lineup groups and tallies only, so no sweep was run.Driver
store-pages-offline.jsonwithstore-pages-offline-mate.jsonthroughlinux-cut-network.sh,--library-store store --cloud-store own, mika and jules, on thestorerunspreview, driver build of this head. Both sides came back clean: 136 and 33 steps. The script now also requires:waitSettledat the end, so the media upload queue and op queue are empty and the chip reads synced.The picture draws on the offline copy (above). After reconnect, Dup A is served and drawn (
expectPicturesServed,drawn).ci: analyze test web library desktop


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issue was found.Summary
Unread pages made on this device now receive the pictures stored for the strategy’s pages. This lets offline copies recognize pictures the server already serves instead of uploading them again.
Reviews (4) · Last reviewed commit: "A page made here takes picture facts in ..." · Reviewed by Greptile