Commit bd9f02c
committed
fix(web): raise 409 on duplicate pane creation
Because both the C display server and Haskell web server layers maintain
independent registries of panes (the former to map them to display
information and the latter to map them to auth tokens), it's kind of
tricky to check the implicit invariant that there never exists an entry
in one that isn't in the other.
You might think that there would be a way to atomically check that the
pane doesn't exist in the C layer before adding it to the Haskell layer,
but that would require doing IO inside an STM transaction, which is
widely considered to be a bad idea.
Instead, we do something moderately hacky, i.e., we just match on the
error message.
Fixes #53.1 parent 48caaca commit bd9f02c
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
| |||
0 commit comments