Skip to content

Conversation

@jackjackbits
Copy link
Collaborator

Summary

  • cache per-message content analysis (max token length + payment link extraction) and reuse in text rendering
  • cache merged private chat message lists with invalidation on chat/peer updates
  • add ID-set based dedup to public timelines to avoid O(n) scans

Testing

  • xcodebuild -project bitchat.xcodeproj -scheme "bitchat (iOS)" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 17' test

Notes

  • iPhone 15 simulator not available locally; used iPhone 17

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d444051542

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 1832 to +1835
func getPrivateChatMessages(for peerID: PeerID) -> [BitchatMessage] {
if let cached = privateChatMessagesCache[peerID] {
return cached
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Invalidate private chat cache when delivery status changes

Because getPrivateChatMessages now returns a cached, already de‑duplicated array, later delivery/read receipt updates that mutate only one of the duplicate message copies (e.g., short vs long peer IDs) won’t recompute the “best by status” choice. In those cases the UI can keep showing the lower‑status copy even after a higher‑status update arrives, since the cache is reused and no merge logic runs again. This regression only shows up when the same message ID exists under multiple peer IDs and delivery status advances on the non‑cached copy.

Useful? React with 👍 / 👎.

@jackjackbits
Copy link
Collaborator Author

Addressed Codex review: I now invalidate the private chat cache whenever delivery/read status changes (Noise receipts, GeoDM receipts, and general status updates). Pushed in 452ecf2.

@jackjackbits
Copy link
Collaborator Author

Follow-up: added commit 9286266 to expose cache invalidation helper for the new status hooks. Re-ran iOS tests but the run timed out at 120s and reported failures in BLEServiceTests/sendPublicMessage, sendPrivateMessage, and sendMessageWithMentions. Happy to re-run with a longer timeout.

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.

1 participant