Fix state events being hidden from widgets in read_events actions (#29954)

This widget driver method was mistakenly filtering all state events out of the responses to read_events fromWidget actions. This was a hold-over from back when read_events had two different behaviors depending on whether you specified a state_key (i.e. before the introduction of the update_state action).
This commit is contained in:
Robin
2025-05-14 10:05:19 -04:00
committed by GitHub
parent be5dd058b3
commit ccd77be74a
2 changed files with 9 additions and 2 deletions

View File

@@ -498,9 +498,9 @@ export class StopGapWidgetDriver extends WidgetDriver {
if (results.length >= limit) break;
if (since !== undefined && ev.getId() === since) break;
if (ev.getType() !== eventType || ev.isState()) continue;
if (ev.getType() !== eventType) continue;
if (eventType === EventType.RoomMessage && msgtype && msgtype !== ev.getContent()["msgtype"]) continue;
if (ev.getStateKey() !== undefined && stateKey !== undefined && ev.getStateKey() !== stateKey) continue;
if (stateKey !== undefined && ev.getStateKey() !== stateKey) continue;
results.push(ev);
}