getstream 通知订阅不会推送带有计数的聚合信息
getstream notification subscription doesn't push aggreagated info with counts
我正在使用 getstream nodejs 包。
我有一个聚合通知提要,它使用 feed.get()
正确获取聚合活动
问题是,当通过 feed.subscribe() 订阅时,我只得到 activity,而不是这里 https://kuus.github.io/getstream/docs/index.html#realtime[=11] 中描述的包含已见和未见计数的聚合信息=]
我是否缺少某些参数?
所以,我尝试了不同版本的 Stream js 客户端(我使用的是 4.3.0v,因为它与 Node v8.0 最新兼容)直到最新的 4.7.0,并且行为仍然存在。看起来 Notifications feeds 并没有真正将聚合数据推送给客户端,只是像 flat feeds 这样的活动。无论如何,这是我找到的解决方法。
feed.subscribe(async ({ new: activities }) => {
const {
results: notifications,
unread,
unseen,
} = await feed.getActivityDetail([activities.map(({ id }) => id)]);
/* ...do something with notifications, unseen and unread */
});
我正在使用 getstream nodejs 包。
我有一个聚合通知提要,它使用 feed.get()
正确获取聚合活动问题是,当通过 feed.subscribe() 订阅时,我只得到 activity,而不是这里 https://kuus.github.io/getstream/docs/index.html#realtime[=11] 中描述的包含已见和未见计数的聚合信息=]
我是否缺少某些参数?
所以,我尝试了不同版本的 Stream js 客户端(我使用的是 4.3.0v,因为它与 Node v8.0 最新兼容)直到最新的 4.7.0,并且行为仍然存在。看起来 Notifications feeds 并没有真正将聚合数据推送给客户端,只是像 flat feeds 这样的活动。无论如何,这是我找到的解决方法。
feed.subscribe(async ({ new: activities }) => {
const {
results: notifications,
unread,
unseen,
} = await feed.getActivityDetail([activities.map(({ id }) => id)]);
/* ...do something with notifications, unseen and unread */
});