fix(images): keep the pointer cache honest - #33
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #33 +/- ##
==========================================
+ Coverage 84.91% 87.84% +2.92%
==========================================
Files 36 36
Lines 2460 2477 +17
Branches 501 517 +16
==========================================
+ Hits 2089 2176 +87
+ Misses 368 297 -71
- Partials 3 4 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
skjnldsv
force-pushed
the
fix/image-pointer-handling
branch
2 times, most recently
from
September 10, 2026 16:25
ce1c608 to
d798df4
Compare
An `up` from a pointer the image never had, one that went down beside it, found an index of -1 in the cache, which `splice(-1, 1)` reads as the last entry: a finger still on the screen was dropped and the pinch it was part of ended. Such an event is nothing to this image now. A pointer the browser takes back, when it turns the gesture into a scroll or the swipe to the next file, sends no `up` at all. Nothing listened for `pointercancel`, so that finger stayed in the cache and left the image mid-drag, or refusing to swipe. The first load is also a request, for an svg or an E2EE file, and it was started without anyone waiting on it: a rejection there reached the console and nothing else, leaving the viewer on its spinner. It reports `errored` like any other failure to load. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
skjnldsv
force-pushed
the
fix/image-pointer-handling
branch
from
September 10, 2026 17:05
d798df4 to
be6b25d
Compare
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.
An
upfrom a pointer the image never had, one that went down beside it, found an index of-1in the cache, andsplice(-1, 1)reads that as the last entry: a finger still on the screen was dropped and the pinch it was part of ended. Such an event is nothing to this image now.A pointer the browser takes back, when it turns the gesture into a scroll or into the swipe to the next file, sends no
upat all. Nothing listened forpointercancel, so that finger stayed in the cache, leaving the image mid-drag or refusing to swipe until another gesture happened to clear it.The first load is also a request, for an svg (fetched to be sanitized) or an E2EE file (fetched by hand), and it was started with nobody waiting on it. A rejection there reached the console and nothing else: the element had nothing to show and the viewer waited on its spinner for a
loadedevent that could never come. It reportserroredlike any other failure to load.Three tests, all failing before. jsdom has no
PointerEventand the coordinates of aMouseEventcannot be set after the fact, so the pointer tests build the events by hand and dispatch them.Note for whoever merges: the
@nextcloud/axiosmock this adds tomedia.spec.tsis the same block #22 adds. Whichever lands second wants one copy of it, not two.👾 This pull request was assisted by Claude Code, commits carry an
Assisted-bytrailer.