Skip to content

Commit d493bd7

Browse files
authored
wssession: set prevIds on filter context to make require-sub work (#48258)
1 parent cad5b88 commit d493bd7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/handler/wssession.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,15 @@ void WsSession::processPublishQueue()
139139
filters = std::make_unique<Filter::MessageFilterStack>(channelFilters[item.channel]);
140140
filtersFinishedConnection = filters->finished.connect(boost::bind(&WsSession::filtersFinished, this, boost::placeholders::_1));
141141

142+
// websocket sessions currently don't support previous IDs on
143+
// subscriptions, but we still need to populate the channel names in
144+
// in the filter context even if all the values will be null
145+
QHash<QString, QString> prevIds;
146+
foreach(const QString &name, channels)
147+
prevIds[name] = QString();
148+
142149
Filter::Context fc;
150+
fc.prevIds = prevIds;
143151
fc.subscriptionMeta = meta;
144152
fc.publishMeta = item.meta;
145153
fc.zhttpOut = zhttpOut;

0 commit comments

Comments
 (0)