fix: group key errors#215
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (3)
📜 Recent review details⏰ Context from checks skipped due to timeout. (4)
🧰 Additional context used📓 Path-based instructions (2)**/*.go📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/!(ltsm)/**/*.go📄 CodeRabbit inference engine (AGENTS.md)
Files:
🔇 Additional comments (4)
📝 WalkthroughSummary by CodeRabbit
WalkthroughGroup E2EE member discovery now validates and deduplicates user MIDs, preserves richer cached lists, resolves missing public keys through batch and individual calls, and propagates wrapped registration errors. ChangesE2EE group key handling
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant registerGroupKey
participant resolveGroupMemberPublicKeys
participant GetLastE2EEPublicKeys
participant negotiateE2EEPublicKey
registerGroupKey->>resolveGroupMemberPublicKeys: resolve candidate member keys
resolveGroupMemberPublicKeys->>GetLastE2EEPublicKeys: request batch last keys
resolveGroupMemberPublicKeys->>negotiateE2EEPublicKey: negotiate missing or invalid keys
resolveGroupMemberPublicKeys-->>registerGroupKey: return resolved keys or error
registerGroupKey->>registerGroupKey: wrap group key for each member
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) Comment |
| // A self-only result is ambiguous: LINE sometimes returns an empty member | ||
| // map for active groups. Keep a previously complete list for fallback. | ||
| if len(mids) <= 1 { | ||
| return |
There was a problem hiding this comment.
Skipping writes when len(mids) <= 1 protects against LINE's ambiguous self-only responses (good), but it also means a group that legitimately shrinks to only self will never update the cache: autoRegisterGroupKey at lines 275-285 will keep falling back to the stale richer list and attempt to wrap keys for departed members, which RegisterE2EEGroupKey will reject (or worse, silently accept with stale members).
Consider adding an authoritative-source flag or a TTL so genuine shrinkage can evict the cache while still shielding against ambiguous server responses.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/connector/e2ee_keys.go`:
- Around line 245-248: Update the comments preceding the `isUserMID(lc.Mid)`
checks in both locations to remove the inaccurate “always include” wording and
describe the conditional behavior accurately, including that the MID is added
only when `isUserMID` returns true.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9207cd09-70e7-4e94-944c-9837855c0464
📒 Files selected for processing (5)
pkg/connector/creategroup.gopkg/connector/e2ee_keys.gopkg/connector/e2ee_keys_test.gopkg/connector/send_message_test.gopkg/connector/sync.go
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: Lint with 1.25
- GitHub Check: build-docker
- GitHub Check: build-docker
- GitHub Check: Lint with 1.25
🧰 Additional context used
📓 Path-based instructions (2)
**/*.go
📄 CodeRabbit inference engine (AGENTS.md)
**/*.go: Usego fmtfor code formatting across all Go files
Usegoimportswith-local "github.com/highesttt/matrix-line-messenger"flag to group project-local imports correctly
Usezerologfor logging throughout the codebase
Do not useMsgfin logging; useMsgwith structured fields instead
UseStringerinterface where applicable in Go code
Files:
pkg/connector/send_message_test.gopkg/connector/e2ee_keys_test.gopkg/connector/creategroup.gopkg/connector/sync.gopkg/connector/e2ee_keys.go
**/!(ltsm)/**/*.go
📄 CodeRabbit inference engine (AGENTS.md)
**/!(ltsm)/**/*.go: Runstaticcheckon all Go files excludingpkg/ltsmpackage (transpiled WASM code)
Rungo veton all Go files excludingpkg/ltsmpackage (transpiled WASM code)
Files:
pkg/connector/send_message_test.gopkg/connector/e2ee_keys_test.gopkg/connector/creategroup.gopkg/connector/sync.gopkg/connector/e2ee_keys.go
🔇 Additional comments (14)
pkg/connector/e2ee_keys.go (3)
44-51: LGTM!
196-209: LGTM!Also applies to: 257-259, 275-284, 326-326, 335-343
234-244: 🎯 Functional CorrectnessNo issue:
isUserMIDmatches LINE MID format. LINE user IDs are uppercaseU-prefixed, so the case-sensitive check does not drop valid members.> Likely an incorrect or invalid review comment.pkg/connector/sync.go (3)
684-731: LGTM!
733-741: LGTM!
928-939: LGTM!pkg/connector/e2ee_keys_test.go (3)
164-181: LGTM!
183-195: LGTM!
197-294: LGTM!pkg/connector/creategroup.go (4)
16-22: LGTM!
142-156: LGTM!
158-206: LGTM!
211-247: LGTM!pkg/connector/send_message_test.go (1)
53-58: LGTM!
No description provided.