element-hq / element-hq/element-ios

UISI bugs with NSE

Open
#5,445 1 comment 0 reactions 0 assignees View on GitHub
A-E2EE A-Notifications A-SDK O-Occasional S-Major T-Defect
Dominant language
Swift
Stars
1.8k
Forks
544
PR merge metrics
PR metrics pending

Description

Writing them down before I forget them:

1. If the NSE receives an Olm to-device message to set up an Olm session with the client, then it will presumably go and claim an OTK from the server and handshake to set up the Olm session. However, the NSE crypto state is ephemeral and gets regularly regularly. Therefore this Olm session will subsequently wedge and have to be recovered by the app when it's next used. This /may/ paper over this failure mode, but relying on unwedging logic for Olm sessions is not great (it adds latency to fix the session).

2. If the NSE and App try to /sync at the same time from the same since token, they will race and could end up with toDevice messsages received on one side but not the other. If the App thinks it has caught up, it will discard any queued up sync responses collected by the NSE, and so potentially discard toDevice messages which were only received on that path. It might even discard sync responses in general received by the NSE.

Contributor guide

Open the contributing guide

Research direction

No file, test, or entry point is named. Start by tracing the NSE's Olm to-device handling and the App/NSE concurrent /sync paths, then determine how ephemeral crypto state and queued sync responses are managed. Done means both described failure modes have a clear, verified resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.