Skip to content

Develop#302

Merged
filinvadim merged 13 commits into
mainfrom
develop
Jun 21, 2026
Merged

Develop#302
filinvadim merged 13 commits into
mainfrom
develop

Conversation

@filinvadim

Copy link
Copy Markdown
Member

No description provided.

claude and others added 13 commits June 21, 2026 17:44
send() appended the optimistic sent message, but the 3s poll could have
already replaced the list with the server's copy of the same id — leaving
two items with the same ULID. The chat LazyColumn keys by message id, so
the duplicate threw IllegalArgumentException ("Key ... was already used")
on the post-send animateScrollToItem and crashed the screen.

Dedupe by the same key the LazyColumn uses before the list reaches state,
in the shared builder used by reload/poll/send.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WmL9gFL2uKNVZDnkm9Mch
TweetListActivity's window-insets listener cast the root view's layoutParams
to CoordinatorLayout.LayoutParams. A content view's layoutParams type comes
from the activity content FrameLayout parent, not from the root itself being
a CoordinatorLayout, so on Nothing OS it is FrameLayout.LayoutParams and the
cast throws — crashing bookmarks/likes/quotes. (OPPO happened to yield
CoordinatorLayout params, so it didn't crash there.)

Apply the system-bar insets as padding on the root instead; padding is
independent of the layoutParams type.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WmL9gFL2uKNVZDnkm9Mch
Compose lists keyed by item id crash with IllegalArgumentException
("Key ... was already used") when the backing data contains a duplicate id
(paging across pages, a server returning a repeat, etc.). The timeline (the
01KVME2WQT crash in the logs) keyed paged tweets by id; notifications,
follow requests, chats, new-chat search, who-to-follow, thread and filters
lists were likewise unguarded.

- Timeline: drop the id key for positional keys, matching SearchTweetesFragment.
- Everything else: de-duplicate by id before display — at the ViewModel
  source, inline at the items() call for plain lists, or via a shared local
  val for index-based lists so indices stay aligned.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WmL9gFL2uKNVZDnkm9Mch
Dropping the timeline's id paging key (to stop the duplicate-key crash)
left three sites reading LazyListItemInfo.key as the status id — the
view-dwell recordView set and the load-more scroll anchoring. Re-derive the
id from the item index via the bounds-safe getOptId(index) so both keep
working with positional keys.

Also from review: chat orderedForDisplay uses one key fn (equal to the
LazyColumn key) for both de-dup and the sort tie-break; the thread de-dup
is memoized with remember.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WmL9gFL2uKNVZDnkm9Mch
Extract messageDisplayKey() shared by ChatMessagesViewModel (de-dup + sort
tie-break) and ChatMessagesActivity's LazyColumn key, so the two can't drift
apart. The id-less fallback is senderId-prefixed (fixed-length ULID) so
distinct messages can't collide on createdAt+text.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WmL9gFL2uKNVZDnkm9Mch
…861u3

Fix warpdroid crashes: duplicate LazyColumn keys + insets ClassCast
… samples

generateSample descended into the first non-empty subdirectory and only fell back to the current directory's files when every subtree failed, so files outside leaf directories were almost never sampled. Treat each subdirectory and each file as equal candidates at every level so coverage spans the whole tree.

Replace the random line substring (which could be a single near-worthless character) with the whole file's contents as the sample. FileStack now carries just the file index.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AKujXgp59pHmUDM4uaiTF
Add deterministic tests on an in-memory tree (fstest.MapFS) for the two fixed bugs: every sample is a whole file (not a substring), files at every directory depth are sampled (not just leaves), the generate/resolve round-trip holds, the challenge equals SHA256(wholeFile + nonce), and the index/empty-stack/empty-codebase error paths.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AKujXgp59pHmUDM4uaiTF
Consolidate the whole-file/all-level traversal tests into the existing challenge_test.go instead of a separate file.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AKujXgp59pHmUDM4uaiTF
io/fs paths (embed.FS, fstest.MapFS) are always slash-separated. filepath.Join produces backslashes on Windows, so traversal below the top level failed and only root files were sampled - breaking sampling on Windows nodes and cross-platform challenges. Switch to path.Join.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AKujXgp59pHmUDM4uaiTF
findSample resolves a SampleLocation that arrives over the wire (JSON) from a peer; a negative file_stack/dir_stack value passed the upper-bound-only check and panicked on slice indexing. Guard both lower bounds and return ErrSampleIndexOutOfBounds. Addresses a PR review comment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AKujXgp59pHmUDM4uaiTF
Simplify challenge sampling to use full file content
@filinvadim filinvadim merged commit 1b37829 into main Jun 21, 2026
6 checks passed
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 88.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
security/challenge.go 88.00% 2 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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.

3 participants