Commit e8667b4
fix(ocap-kernel): regenerate incarnationId on resetStorage=true
The peer-restart detection added in #948 only works if the sender
signals a new incarnation after a state wipe. The previous except-list
in Kernel.#resetKernelState kept `incarnationId` alive across
`resetStorage=true`, so a kernel-worker rebooted with the same
incarnation as before — the receiver's persisted comparison decided
"no restart," `highestReceivedSeq` stayed put, and fresh `seq=1`
messages were dropped as duplicates.
The browser kernel-worker hits this path on every offscreen-page
reload (the URL carries `?reset-storage=true`), so every extension
reload that re-registered a service silently dropped its first
message. Dropping `incarnationId` from the except-list lets
`provideIncarnationId` regenerate it, which is what the doc comment
on that function already advertised.
Adds an e2e regression covering the resetStorage path specifically
(the existing #944 test goes through fresh-DB, which exercises a
different code branch and didn't catch the bug).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ec3d701 commit e8667b4
3 files changed
Lines changed: 90 additions & 3 deletions
File tree
- packages
- kernel-node-runtime/test/e2e
- ocap-kernel
- src
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1118 | 1118 | | |
1119 | 1119 | | |
1120 | 1120 | | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
1121 | 1194 | | |
1122 | 1195 | | |
1123 | 1196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
707 | 715 | | |
708 | | - | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
709 | 719 | | |
710 | 720 | | |
711 | 721 | | |
| |||
714 | 724 | | |
715 | 725 | | |
716 | 726 | | |
717 | | - | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
718 | 730 | | |
719 | | - | |
| 731 | + | |
720 | 732 | | |
721 | 733 | | |
722 | 734 | | |
| |||
0 commit comments