问题标签 [getstream-io]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
token - 可以在客户端还是仅在服务器端创建提要令牌?
可以在客户端还是仅在服务器端创建提要令牌?我正在构建一个带有 nodejs 后端的 Ionic 应用程序。只是想知道我是否需要首先在服务器端为我的用户创建提要令牌,或者是否可以在客户端这样做。
feed - 获取流:通过 2 个跟随关系传播活动?
情况:
- 想象两个模型:歌曲和播放列表
- 您只能向歌曲添加反应(动词,例如“喜欢”、“不喜欢”等)。
- 每首歌曲都列出了它的聚合动词,例如 2 个用户喜欢这首歌,4 个不喜欢它。
- 我设置了两个提要组:Song_flat(平面)和 Song_aggregated(聚合)
- 动词被添加到 Song_flat,而 Song_aggregated 跟随 Song_flat。
- 到目前为止,这工作正常,包括。实时更新。
挑战:
- 播放列表应显示此播放列表中所有歌曲的聚合视图(再次按动词)。
- 我设置了两个提要组:Playlist_flat(平面)和 Playlist_aggregated(聚合)
- Playlist_flat 遵循与其关联的所有 Song_flat 提要。Playlist_aggregated 遵循 Playlist_flat。
- 所以总的来说:Playlist_aggregated 遵循 Playlist_flat 遵循大量 Song_flat 提要。
- 我需要中间 Playlist_flat 提要,以便实时更新 Playlist_aggregated 提要无法提供的所有 Song_flat 更改。
- 问题:虽然 Playlist_flat 会立即列出添加到其歌曲中的动词,但 Playlist_aggregated不包含任何动词,尽管 Playlist_aggregated 在 Playlist_flat 之后。
问题:
- 是 getstream 中的错误还是动词没有通过 2 个链接追随者传播?
- 那么,我是否必须要求 Playlist_aggregated 直接关注 Song_flat 提要而不是通过 Playlist_flat?
谢谢你。曼努埃尔
getstream-io - Realtime update for updated activity
I'm playing around with getstream.io, it's an amazing tool but I have a question regarding realtime updates.
I am connected to realtime updates of a feed via Javascript (simply following examples from getstream.io).
Which works beautifully, adding and removing activities to the feed triggers the callback function. However if I (via python) update an activity of a feed.
I see that the update was successful if I call feed.get() but I don't get a realtime notification in Javascript, shouldn't I? Am I doing something wrong?
getstream-io - 流明的 Getstream 支持
我正在尝试将 getstream 与 Lumen 一起使用,似乎他们创建的 laravel 包与 Lumen 不兼容。这里有没有人在 Lumen 中使用 getstream ?
getstream-io - 所有用户的帖子从高到低排名
如果用户的帖子包含评论和喜欢以及创建日期,我如何实施某种排名,涉及评论和喜欢的数量以及创建日期和从最高帖子到最低帖子的返回帖子。
getstream-io - 使用 java 流客户端更新 GetStream.IO 中的混合类型活动会丢失类型属性
我采用了 java 流客户端 ( https://github.com/GetStream/stream-java ) 附带的 MixedType 示例代码,并使用 updateActivities 添加了更新步骤。更新后,存储在流中的活动会丢失“类型”属性。当您再次获得活动并且正在反序列化活动时,Jackson 会使用此属性。
所以我得到:
Exception in thread "main" Disconnected from the target VM, address: '127.0.0.1:60016', transport: 'socket'
com.fasterxml.jackson.databind.JsonMappingException: Could not resolve type id 'null' into a subtype of [simple type, class io.getstream.client.apache.example.mixtype.MixedType$Match]
at [Source: org.apache.http.client.entity.LazyDecompressingInputStream@29ad44e3; line: 1, column: 619] (through reference chain: io.getstream.client.model.beans.StreamResponse["results"]->java.util.ArrayList[1])
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)
at com.fasterxml.jackson.databind.DeserializationContext.unknownTypeException(DeserializationContext.java:849)
请参阅此处我更新了示例:
知道这里发生了什么吗?
getstream-io - getstream.io 的预期性能
getstream.io 文档说人们应该期望在大约 60 毫秒内检索到一个提要。当我检索我的提要时,它们包含一个名为“持续时间”的字段,我采用的是计算出的服务器端处理时间。这个值稳定在 10-40ms 左右,平均在 15ms 左右。
问题是,我很少在不到 150 毫秒的时间内收到我的提要,平均时间大约是 200-250 毫秒,有时甚至高达 300-400 毫秒。这是单独获取提要的时间,没有丰富等,我已经用 tcpdump 验证了网络往返时间很低(大约 25 毫秒),并且时间实际上是在等待服务器响应。
我试图移动我的应用程序(eu-west 和 eu-central),但这似乎并没有太大影响(再次,网络往返稳定在 25 毫秒左右)。
我的问题是——我真的应该期待 60 毫秒并继续调查,还是 200-400 毫秒正常?在 getstream.io 网站上解释说开发人员帐户接收“低优先级处理” - 这在实践中意味着什么?我可以期望与另一个计划有多大的不同?
我正在使用节点 js 低级 API。
ruby-on-rails - How to prevent duplicate follows after initial setup
I have a Rails application that uses GetStream to implement a newsfeed functionality. Everytime a user logs in, the user follows every single location they have access to. The only issue is that a user could possibly belong to 1000+ stores making performance a huge issue.
After setting up the user the first time (the longest time because all follows need to be created), what would be the correct way to prevent duplicate follows? Would it be to set a boolean flag on the user to not follow everytime they log in and only create a new follow each time the user is given access to a new location?
Or maybe GetStream is already smart enough to notice duplicates so it doesn't write each time it receives the same information?
getstream-io - 检索“时间”字段时的时区错误?
该手册指定唯一性基于foreign_id
和time
字段。
我有一个用户加入特定事件的活动。该事件有自己的开始日期,我想在时间线中显示,因此我将其作为额外数据提交(以及名称和位置等,但我在这里省略了这些以防止混乱)。我将具有以下活动数组的活动提交给用户供稿。请注意,我在阿姆斯特丹(目前)处于 GMT+0200 时区:
当我检索该用户的用户提要时,返回如下:
请注意日期字段中的差异。两者都作为 ISO8601 字段提交,但仅event_start
返回该字段。该time
字段以不同的格式返回,但没有任何时区指示符。它显然已转换为 UTC 时间,但缺少应指示. 因此,我不能可靠地将它用作时间指示器。
我可以通过向活动数组添加另一个时间字段(它工作正常并返回正确的 ISO8601 日期)来解决这个问题,但这感觉非常多余。
这是一个错误,是我做错了什么,还是我们不应该仅仅依赖该time
字段来指示活动何时发生?
getstream-io - 如何在 getstream-io 中创建公共活动
我想广播一些活动,例如“用户加入”让所有成员看到。目前我有一个平坦的user
饲料。有没有办法推动一个活动,让每个人都能看到它?