0
votes

Ok, So I'm trying to add in GetStream to an application which will allow users to comment. Firstly struggling to understand the "backwards" grammar of the documentation I'm also struggling to get a method working correctly (This is down to bad documentation) as all I'm trying to do is check if a user is following a specific feed:

userFeed!.following(filter: [FeedId(feedSlug: "element", userId: uuid)], limit: 1) { result in}

The above fails with the following reason:

Cannot convert return expression of type 'Cancellable' to return type 'Bool'

This is a snippet from their own docs:

user1.following(filter: [FeedId(feedSlug: "user", userId: "42"),
                     FeedId(feedSlug: "user", userId: "43")], limit: 2) { result in /* ... */ }

Has anyone worked with GetStream who can help with this?

Thanks

1
It works for me. Can you show more context of your code? - buh
Sure: This is the only other piece of code that has interaction with the userFeed and is set at initialisation - Which GetStream returns a success on. userFeed = Client.shared.flatFeed(feedSlug: "user", userId: "\(user.id)") - user7684436
I recommend you don't use userId: "\(user.id)". It always should be the current user id. So, how it's possible that you get Bool where the following returns discardable Cancellable? Can you confirm you store user feed as an instance variable? - buh
user.id is an assigned value outside of GetStream and our own id value. But I can remove for brevity. Unknown how Cancellable is declaring itself a Bool, perhaps it defaults to isCancelled, Managed to address this issue by providing the ending method to the block - `{ result in }.cancel() - Whether this will result in it not checking is for another thread. The documentation could do with thickening out on these things - user7684436
Also this may cause issues when attaching follows to a given activity within a feed as when attempting to follow a group results in the following error: Optional(FeedConfigException[6] Status Code: 400, "d22bff18-e6f4-4ffc-a4fe-9bbcf5f086ac" is not a valid feed group) - user7684436

1 Answers

1
votes

From your logs the issue is more clear. The feed id can't contain more than 1 colon.