Repository navigation
Fix Instagram carousel media ordering - #45
Merged
Merged
Conversation
Co-Authored-By: codex <[email protected]>
Co-Authored-By: codex <[email protected]>
Validate direct image bytes against the full response length rather than a separate Range representation. Preserve bounded unknown-length loading and reject empty or invalid image responses. Co-Authored-By: codex <[email protected]>
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.
Changes
Preserve every extractable Instagram sidecar entry in source order, including legitimate repeated media URLs, with each item's own preview and download association.
Fix direct image Share / Save when the CDN serves different representations for Range and full GET requests. The previous frontend compared the full image against the probe's size and returned to idle before Tap Again. Validate against the full response's Content-Length when present; otherwise count streamed bytes under the existing 100 MiB limit. Keep strict image MIME checks, reject empty/incomplete responses, and cancel oversized transfers.
Evidence
Physical acceptance exposed the mixed-carousel image failure. Revision 2 unknown-size handling was insufficient: read-only proxy reproduction measured Image 1 Range total 644,078 bytes versus a complete full JPEG of 539,811 bytes, while the working single-image example matched at 337,218 bytes. Revision 3 corrects that cross-request size comparison.
Scope and validation
Revision 3 changes only mobile-share.js and its tests. The parser ordering fix remains intact; video OPFS, share-session, backend, provider security rules, and UI layout are unchanged. Tests verify ready state and trusted second activation, correct full-response length validation, unknown-length progress, MIME/status rejection, empty bodies, and bounded stream cancellation. Existing five-item mixed-carousel and duplicate-preservation coverage remains.
Local JS: 102 passing; Python: 330 passing, 3 existing skips; PHP: 198 tests completed with isolated missing-.env warnings. Build, lint and dependency audits passed. Physical iPhone acceptance remains pending; do not merge.