stream_feeds 0.6.1
stream_feeds: ^0.6.1 copied to clipboard
The official Dart client for Stream Feeds, a service for building applications with activity feeds.
0.6.1 #
🐛 Bug Fixes #
Feed.stopWatching()now stops the feed watching itself again, both when the connection comes back and whenqueryMoreActivities()loads a page;getOrCreate()starts it again, and a feed that was never fetched no longer fetches itself on reconnect
🔄 Changed #
- Update API spec to v239.12.0
0.6.0 #
💥 BREAKING CHANGES #
- Raised the minimum Dart SDK to
^3.12.0 Banremoved, replaced byBanInfoResponse:targetis nowuser,shadowis optional rather than required, andchannelis gonePollResponseData.votingVisibilityis now required, and typedPollResponseDataVotingVisibilityrather thanString, so anything constructing one directly must supply it and wrap the valueActivityCommentList.statereturnsActivityCommentListStaterather thanStateNotifier<ActivityCommentListState>, matching the other state classes- Removed the call, recording, streaming and chat types that were never part of the Feeds API
- Every failure the SDK reports for work it attempted now arrives as a
StreamExceptionsubclass —StreamApiException,StreamNetworkException,StreamAuthenticationExceptionorStreamClientException— replacingClientExceptionandHttpClientException, which are removed.StreamApiErrorremains, as the server's error payload and the type ofConnectionErrorEvent.error, but is no longer what the SDK throws or returns.StreamFeedsExceptionaliases the base type, so oneonclause catches all four connectthrows aStateErrorwhen a connection is already established or in progress, and aStreamFeedsExceptioncarrying the cause when it failsStreamAttachmentUploader.upload, reached throughStreamFeedsClient.attachmentUploader, returns anAttachmentUploadTaskrather than aFuture<Result<UploadedAttachment>>, and takes noonProgress: progress arrives on the task'sstate.uploadBatchreturns anAttachmentUploadBatchrather than aStream<Result<UploadedAttachment>>Feed.addActivity,Feed.addCommentandActivity.addCommentsBatchthrow anArgumentErrorwhen two attachments in one request share an id, rather than reporting it through the returnedResult- Generated enums are
extension types overStringinstead of Dartenums..values,.name,.index, exhaustiveswitchand theunknownmember are gone; an unrecognized value now passes through as-is instead of collapsing tounknown ActivityDataVisibility,CollectionStatus,FeedVisibility,FeedMemberStatusandFollowStatuslost theirunknownconstants. Unrecognized values arrive verbatim, so a comparison againstunknownno longer matches anything- Removed the
toModel()extensions on the generated enums:ActivityResponseVisibilityMapper,EnrichedCollectionResponseStatusMapper,FeedInputVisibilityEnumMapper,FeedMemberResponseStatusMapper,FollowResponseStatusMapper. UseActivityDataVisibility(visibility)in place ofvisibility.toModel() FeedData.visibility,CommentData.statusandFollowData.pushPreferenceare nowFeedVisibility?,CommentStatusandFollowPushPreference. All three implementString, so only code that constructs these models has to wrap the valueFeedAddActivityRequest.visibilityis now anActivityDataVisibility?andFeed.follow'spushPreferenceaFollowPushPreference?. Swap the name at the call site —AddActivityRequestVisibility.tagbecomesActivityDataVisibility.tag; the constants are named identically, so it is a type-name change onlyFeedAddActivityRequest.expiresAttakes aDateTime?rather than aString?EpochDateTimeConverteris replaced bystream_core'sStreamDateTimeConverter. DeserializedDateTimes are UTC rather than local, so useisAtSameMomentAsto compare across zones; serialization writes RFC3339 instead of epoch nanosecondsAIVideoConfigis split intoAIVideoConfigRequestandAIVideoConfigResponse, which are not interchangeable:enabledandrulesare required on the response, optional on the requestBanRequestlostbannedByandbannedById
✨ Features #
- Guest users (
User.guest(id)) can now connect, with the same read and write access and the same real-time updates as a regular user; their id is assigned on connect, so read it fromclient.userafterwards - Added
StreamFeedsClient.dispose, which releases the client for good;connectthrows aStateErrorafterwards - Added a
connectWebSocketflag toconnect. Passfalsefor a client that only makes requests: no real-time updates arrive, and a watched query is rejected - Added
FeedsConfig.logConfig, which says how much the client reports and where those records go; left out, the client stays silent. Records include theAuthorizationheader, so weigh what reads them - Added
StreamFeedsClient.userList, a paginated, filterable and sortable query over users, in the same shape as the other list APIs - Added
isReadandisSeentoActivityDataandAggregatedActivityData, for notification-feed read/seen state - Added
friendReactionCountandfriendReactionstoActivityData, exposing reactions from friends - Added
metricstoActivityData, carrying impressions, clicks and similar - Added
bookmarkCountandeditedAttoCommentData, andlocationtoFeedData - Added
createNotificationActivity,skipPushandenrichOwnFieldsflags toFeedAddActivityRequest - Added
customHeaderstoFeedsConfig, sent with every API request. The SDK's own headers win where they overlap, and none of this reaches the WebSocket - Added
skipEnrichUrltoFeedAddActivityRequest,ActivityAddCommentRequestandActivityUpdateCommentRequest, which leaves URLs in the text unenriched - Added
restrictRepliestoActivityDataandFeedAddActivityRequest, saying who may comment on an activity: everyone, nobody, or people the author follows - Added
enrichmentOptionstoFeedQuery. PassEnrichmentOptions(enrichOwnFollowings: true)forownFollowingson each activity, which is what tells you whether the current user may comment whenrestrictRepliesispeople_i_follow - Added a
deleteNotificationActivityflag to thedeleteActivity,deleteComment,deleteActivityReactionanddeleteCommentReactionmethods onFeedandActivity, which deletes the matching notification activity too - A restored activity or comment now reappears in feed and list state, through
ActivityRestoredEventandCommentRestoredEvent - Added
i18ntoActivityDataandCommentData, holding the translations of the text keyed by language code, for activities and comments that have been translated - Added
latestSharestoActivityData, the most recent shares behind the existingshareCount, as a list of the newShareData
🐛 Bug Fixes #
- Fixed a batch never running again after its first: an add that arrived once a batch had run joined that settled one instead of starting its own, so feed capabilities were fetched once per client and every feed discovered afterwards was answered with the first batch's result
- Fixed
connectfailing when called straight afterdisconnect - Fixed a connection that could not authenticate hanging until it timed out, rather than failing with the reason
- Fixed the
X-Stream-Clientheader: the SDK identifier was sent twice, the version was hardcoded, and the OS was left out
🔄 Changed #
markRead,markSeen,markAllReadandmarkAllSeennow update the per-activity and per-groupisRead/isSeenflags on the feed state, next to the aggregate notification counts. The flags stay in sync when theactivity.markedevent arrives, and are re-derived wheneverfeeds.notification_feed.updatedreports a new notification status, so a mark performed on another device shows up here tooActivityData.currentFeedandFeedData'sown_*fields (ownMembership,ownFollowings,ownFollows,ownBookmarks,ownReactions) are now taken fromupdateActivity,updateActivityPartialandupdateFeedresponses when the request setenrichOwnFields: true. Without it, existing state is preserved, since an omittedown_*field means "not fetched", not "empty"- Attachment uploads for a batch of requests now share one concurrency limit instead of one each, so
Activity.addCommentsBatchno longer starts several uploads per comment at once; a failure also calls off the uploads still in flight rather than letting them finish work that is about to be discarded disconnectnow only closes the connection, leaving the client reusable with its existing subscriptions intact; releasing it isdispose- An expired token now recovers on its own: the connection comes back with one the
TokenProviderissued afterwards, without the app doing anything - Renamed the types below. The old names still compile, with a deprecation warning, and
dart fix --applymigrates them:
| Old name | New name |
|---|---|
FollowPair |
UnfollowPair |
ActivityLocation |
Location |
OwnUser |
OwnUserResponse |
UserMute |
UserMuteResponse |
Poll |
PollResponseData |
PollOption |
PollOptionResponseData |
PollVote |
PollVoteResponseData |
BanActionRequest |
BanActionRequestPayload |
BanActionRequestDeleteMessages |
BanActionRequestPayloadDeleteMessages |
BlockActionRequest |
BlockActionRequestPayload |
ShadowBlockActionRequest |
ShadowBlockActionRequestPayload |
CustomActionRequest |
CustomActionRequestPayload |
DeleteUserRequest |
DeleteUserRequestPayload |
DeleteActivityRequest |
DeleteActivityRequestPayload |
DeleteCommentRequest |
DeleteCommentRequestPayload |
DeleteReactionRequest |
DeleteReactionRequestPayload |
DeleteMessageRequest |
DeleteMessageRequestPayload |
MarkReviewedRequest |
MarkReviewedRequestPayload |
RejectAppealRequest |
RejectAppealRequestPayload |
RestoreActionRequest |
RestoreActionRequestPayload |
UnbanActionRequest |
UnbanActionRequestPayload |
UnblockActionRequest |
UnblockActionRequestPayload |
BanResponse |
ModerationBanResponse |
CallResponse |
ModerationCallResponse |
FlagResponse |
FlagItemResponse |
0.5.1 #
- Added missing state updates for the websocket events.
- Add appeal-related methods to moderation client:
appeal,getAppeal, andqueryAppeals. - Add
activityCountfield toFeedDatamodel to track the number of activities in a feed. - Add
ownFollowingsfield toFeedDatamodel to track feeds that the current user is following from this feed. - Add batch follow and unfollow support.
- Add
updateActivityPartialmethod toFeedfor partially updating activities. - Add collections API methods:
readCollections,createCollections,updateCollections, anddeleteCollections. - Add
CollectionDatamodel andcollectionsfield toActivityDatafor enriched collection data. - Add
collectionRefsfield toFeedAddActivityRequestto attach collections to activities.
0.5.0 #
- [BREAKING] Unified
ThreadedCommentDataintoCommentDatato handle both flat and threaded comments. - [BREAKING] Renamed
ActivitiesFilterField.typetoActivitiesFilterField.activityType. - [BREAKING] Changed
ActivityData.locationfield type fromActivityLocation?toLocationCoordinate?. - Add support for
enforceUniqueparameter while adding reactions. - [BREAKING] Changed default behavior for
ActivityAddedEventin feeds: activities from other users are now ignored by default. Only activities from the current user matching the feed's filter are added. AddonNewActivitycallback tofeed,feedFromId, orfeedFromQueryto customize. - Add location filtering support for activities with
ActivitiesFilterField.nearandActivitiesFilterField.withinBoundsfilter fields. - Add new activity filter fields:
ActivitiesFilterField.feedandActivitiesFilterField.interestTags. - Export previously missing public APIs: models, state objects, and queries.
- Add
ownFollowsfield toFeedDatato store the follow relationships of the current user in the feed.
0.4.0 #
- [BREAKING] Change
queryFollowSuggestionsreturn type toList<FeedSuggestionData>. - [BREAKING] Remove
activitySelectorOptionsfromFeedQuery. - Add
activityFeedbackmethod toFeedandActivityfor submitting activity feedback. - Add
hiddenandpreviewfields toActivityData. - Update follower and following counts on the feed state when receiving follow websocket events.
- Fix FeedsReactionData id for updating reactions in the feed state.
- Improvement for stories and minor updates to other AggregatedActivity state updates.
- Export all the State classes and Queries used in the SDK.
0.3.1 #
- Update API client with renaming
addReactiontoaddActivityReactionanddeleteReactiontodeleteActivityReaction. - Update
activity.currentFeedcapabilities when adding or updating activity from websocket events.
0.3.0 #
- [BREAKING] Renamed
AppLifecycleStateProvidertoLifecycleStateProviderandAppLifecycleStatetoLifecycleState. - Re-watch websocket events for feeds when the websocket reconnects.
0.2.0 #
- [BREAKING] Update API client code, specifically the FeedOwnCapability enum.
- Fix unknown enums for
List<FeedOwnCapability>inGetOrCreateFeedResponseto beFeedOwnCapability.unknown. - Fix for updating poll votes from web socket events.
0.1.0 #
- Initial release of Feeds V3 SDK for Dart and Flutter.