File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,6 +118,24 @@ func listenForNotifications(ctx context.Context, s *server) error {
118118 continue
119119 }
120120 if ! matched {
121+ // For updates: the feature was in the client's subscription but no longer matches.
122+ // Send a synthetic delete so the client removes the stale row.
123+ // For inserts: the row was never in the client's DB — nothing to remove.
124+ if payload .Op == "update" {
125+ gone := DeltaMessage {
126+ Type : "delta" ,
127+ Op : "delete" ,
128+ Feature : Feature {"id" : featureID },
129+ OriginClientID : payload .OriginClientID ,
130+ }
131+ if goneMsg , err := json .Marshal (gone ); err == nil {
132+ select {
133+ case cand .client .send <- goneMsg :
134+ default :
135+ log .Printf ("datum-server: client %s send buffer full, dropping gone notification" , cand .id )
136+ }
137+ }
138+ }
121139 continue
122140 }
123141 }
You can’t perform that action at this time.
0 commit comments