Commit d0f0a66
committed
domain: Add id field to server objects.
This id will be passed around in events to uniquely identify a server.
This id is not user generated, it is generated in app by domain-util.ts
and stored in our JSON DB. This commit just adds the logic for
generating and storing the id in the JSON DB. This commit does not make
use of this newly added id, that will be done in further commits to keep
the commits readable.
In further commits, we will also start setting tabId in the rendered
code to this id. We generate a random hex string for this id instead of
having a numeric incremental ID. The reason for this is to avoid
overhead of maintaining an ever increasingly numeric id while trying to
make sure that ID collisions don't happen. Since we don't store our data
in a real database, we can't have incremental primary keys by default
and it makes little sense to implement that on our own, when this field
is just being passed around to communicate b/w code and is not shown to
humans.1 parent be75baf commit d0f0a66
File tree
4 files changed
+64
-12
lines changed- app
- common
- main
- renderer/js/utils
4 files changed
+64
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | | - | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
26 | | - | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
34 | 53 | | |
35 | 54 | | |
36 | 55 | | |
| |||
88 | 107 | | |
89 | 108 | | |
90 | 109 | | |
91 | | - | |
92 | | - | |
| 110 | + | |
| 111 | + | |
93 | 112 | | |
94 | 113 | | |
95 | 114 | | |
| |||
117 | 136 | | |
118 | 137 | | |
119 | 138 | | |
120 | | - | |
| 139 | + | |
121 | 140 | | |
122 | 141 | | |
123 | 142 | | |
| |||
126 | 145 | | |
127 | 146 | | |
128 | 147 | | |
129 | | - | |
| 148 | + | |
130 | 149 | | |
131 | 150 | | |
132 | 151 | | |
133 | 152 | | |
134 | 153 | | |
135 | | - | |
| 154 | + | |
136 | 155 | | |
137 | 156 | | |
138 | 157 | | |
| |||
151 | 170 | | |
152 | 171 | | |
153 | 172 | | |
154 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
155 | 178 | | |
156 | 179 | | |
157 | 180 | | |
| |||
168 | 191 | | |
169 | 192 | | |
170 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
171 | 219 | | |
172 | 220 | | |
173 | 221 | | |
| |||
192 | 240 | | |
193 | 241 | | |
194 | 242 | | |
| 243 | + | |
195 | 244 | | |
196 | 245 | | |
197 | 246 | | |
| |||
0 commit comments