Symptom
On ODM launch, cameras discovered via WS-Discovery fail to connect with saved credentials ~100% of the time. The same camera connects successfully if the user waits ~10 seconds and retries manually. This is 100% reproducible.
Hypothesis
There is a race condition between:
- WS-Discovery completing and triggering auto-connect with saved credentials
- The credential store finishing its async load from disk (DPAPI decryption)
When auto-connect fires before the credential store is ready, SetupUserNameToken either uses empty/default credentials or skips auth entirely. The camera rejects the attempt. By the time the user retries manually, the credential store has loaded and auth succeeds.
Supporting evidence from auth.log:
23:35:08.432 AuthView.Init: startup — version timestamp 2.2.252.15
23:35:31.577 btLogin_Click: name=admin storeCount=0
storeCount=0 at the time of login click indicates the credential store was not populated at connection time.
Required investigation
Add diagnostic logging at these points to confirm the race:
- Credential store load: log when DPAPI decryption starts and completes, and how many credentials were loaded
- Auto-connect trigger: log the exact timestamp when discovery triggers auto-connect and what credentials (if any) are available at that moment — specifically log
storeCount at the point SetupUserNameToken is called during auto-connect
- SetupUserNameToken: already logs username — add log of whether credentials came from store vs. empty/anonymous
- Retry path: log when the user manually reconnects and what
storeCount is at that point
Expected fix (after logging confirms the race)
Delay auto-connect until the credential store signals it is ready, OR queue auto-connect attempts and retry with credentials once they are available.
Priority
High — this makes ODM unusable on startup for cameras with saved credentials.
Symptom
On ODM launch, cameras discovered via WS-Discovery fail to connect with saved credentials ~100% of the time. The same camera connects successfully if the user waits ~10 seconds and retries manually. This is 100% reproducible.
Hypothesis
There is a race condition between:
When auto-connect fires before the credential store is ready,
SetupUserNameTokeneither uses empty/default credentials or skips auth entirely. The camera rejects the attempt. By the time the user retries manually, the credential store has loaded and auth succeeds.Supporting evidence from
auth.log:storeCount=0at the time of login click indicates the credential store was not populated at connection time.Required investigation
Add diagnostic logging at these points to confirm the race:
storeCountat the pointSetupUserNameTokenis called during auto-connectstoreCountis at that pointExpected fix (after logging confirms the race)
Delay auto-connect until the credential store signals it is ready, OR queue auto-connect attempts and retry with credentials once they are available.
Priority
High — this makes ODM unusable on startup for cameras with saved credentials.