Commit 705eeab
committed
fix(unreal): suppress spurious OnInsert on overlapping subscription refcount bump
ClientCache::ApplyDiff phase 2 unconditionally appended every incoming
row to Diff.Inserts, even when the row was already cached and only the
refcount needed to bump. BroadcastDiff then fired OnInsert for every
entry, so any table subscribed via two overlapping queries (e.g. a
global SELECT plus a per-row WHERE) re-fired its insert handler on
every later subscription apply.
Mirror the delete path: only emit a Diff.Inserts entry when the
row-bytes key transitions from absent to refcount=1. Real updates are
unaffected — update bytes differ from old bytes, take the !Entry path,
and DeriveUpdatesByPrimaryKey still reconciles them into OnUpdate.1 parent 458eac8 commit 705eeab
1 file changed
Lines changed: 9 additions & 5 deletions
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | 123 | | |
125 | 124 | | |
126 | 125 | | |
127 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
128 | 130 | | |
| 131 | + | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
132 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
133 | 139 | | |
134 | 140 | | |
135 | | - | |
136 | | - | |
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
| |||
0 commit comments