Commit 8a11dc7
committed
CollectorInvite.patientUsername: read from accessInfo (topology-agnostic)
The previous getter parsed `apiEndpoint` URL path for the username, which
only works on dnsLess=true platforms (path-based). On dnsLess=false hosts
(`{username}.host/`), the path is empty and the getter returned null —
breaking any caller relying on it (notably doctor-dashboard EmbedInvite,
which fell through to a "Only pendings can be shared" error when the
patient was on a dnsLess=false platform).
New behaviour:
- patientUsername returns `accessInfo.user.username` once accessInfo is
loaded; throws HDSLibError if checkAndGetAccessInfo() has not been
awaited first; still returns null when status !== 'active'.
- AppManagingAccount.getContacts() now batches Promise.allSettled of
checkAndGetAccessInfo() across active invites before calling
toContactSource() so the cache is warm.
Cost: +1 /access-info round-trip per active invite the consumer needs a
username for. Acceptable tradeoff vs. silently broken DNS-less.1 parent 6833d13 commit 8a11dc7
2 files changed
Lines changed: 15 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
192 | 197 | | |
193 | 198 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
| 199 | + | |
| 200 | + | |
203 | 201 | | |
| 202 | + | |
204 | 203 | | |
205 | 204 | | |
206 | 205 | | |
| |||
0 commit comments