about summary refs log tree commit diff
path: root/app/services/remove_status_service.rb
AgeCommit message (Collapse)Author
2017-09-26Send streaming API delete to people mentioned in status (#5103)Eugen Rochko
- Previously they wouldn't receive it unless they were author's followers - Skip unpush from public/hashtag timelines if status wasn't public in the first place
2017-09-20Change IDs to strings rather than numbers in API JSON output (#5019)aschmitz
* Fix JavaScript interface with long IDs Somewhat predictably, the JS interface handled IDs as numbers, which in JS are IEEE double-precision floats. This loses some precision when working with numbers as large as those generated by the new ID scheme, so we instead handle them here as strings. This is relatively simple, and doesn't appear to have caused any problems, but should definitely be tested more thoroughly than the built-in tests. Several days of use appear to support this working properly. BREAKING CHANGE: The major(!) change here is that IDs are now returned as strings by the REST endpoints, rather than as integers. In practice, relatively few changes were required to make the existing JS UI work with this change, but it will likely hit API clients pretty hard: it's an entirely different type to consume. (The one API client I tested, Tusky, handles this with no problems, however.) Twitter ran into this issue when introducing Snowflake IDs, and decided to instead introduce an `id_str` field in JSON responses. I have opted to *not* do that, and instead force all IDs to 64-bit integers represented by strings in one go. (I believe Twitter exacerbated their problem by rolling out the changes three times: once for statuses, once for DMs, and once for user IDs, as well as by leaving an integer ID value in JSON. As they said, "If you’re using the `id` field with JSON in a Javascript-related language, there is a very high likelihood that the integers will be silently munged by Javascript interpreters. In most cases, this will result in behavior such as being unable to load or delete a specific direct message, because the ID you're sending to the API is different than the actual identifier associated with the message." [1]) However, given that this is a significant change for API users, alternatives or a transition time may be appropriate. 1: https://blog.twitter.com/developer/en_us/a/2011/direct-messages-going-snowflake-on-sep-30-2011.html * Additional fixes for stringified IDs in JSON These should be the last two. These were identified using eslint to try to identify any plain casts to JavaScript numbers. (Some such casts are legitimate, but these were not.) Adding the following to .eslintrc.yml will identify casts to numbers: ~~~ no-restricted-syntax: - warn - selector: UnaryExpression[operator='+'] > :not(Literal) message: Avoid the use of unary + - selector: CallExpression[callee.name='Number'] message: Casting with Number() may coerce string IDs to numbers ~~~ The remaining three casts appear legitimate: two casts to array indices, one in a server to turn an environment variable into a number. * Back out RelationshipsController Change This was made to make a test a bit less flakey, but has nothing to do with this branch. * Change internal streaming payloads to stringified IDs as well Per https://github.com/tootsuite/mastodon/pull/5019#issuecomment-330736452 we need these changes to send deleted status IDs as strings, not integers.
2017-08-29Serialize ActivityPub alternate link into OStatus deletes, handle it (#4730)Eugen Rochko
Requires moving Atom rendering from DistributionWorker (where `stream_entry.status` is already nil) to inline (where `stream_entry.status.destroyed?` is true) and distributing that. Unfortunately, such XML renderings can no longer be easily chained together into one payload of n items.
2017-08-28Fix deletion of status which has been reblogged (#4728)unarist
2017-08-26Add ActivityPub serializer for Undo of Announce (#4703)Eugen Rochko
2017-08-26Add handling of Linked Data Signatures in payloads (#4687)Eugen Rochko
* Add handling of Linked Data Signatures in payloads * Add a way to sign JSON, fix canonicalization of signature options * Fix signatureValue encoding, send out signed JSON when distributing * Add missing security context
2017-08-13ActivityPub delivery (#4566)Eugen Rochko
* Deliver ActivityPub Like * Deliver ActivityPub Undo-Like * Deliver ActivityPub Create/Announce activities * Deliver ActivityPub creates from mentions * Deliver ActivityPub Block/Undo-Block * Deliver ActivityPub Accept/Reject-Follow * Deliver ActivityPub Undo-Follow * Deliver ActivityPub Follow * Deliver ActivityPub Delete activities Incidentally fix #889 * Adjust BatchedRemoveStatusService for ActivityPub * Add tests for ActivityPub workers * Add tests for FollowService * Add tests for FavouriteService, UnfollowService and PostStatusService * Add tests for ReblogService, BlockService, UnblockService, ProcessMentionsService * Add tests for AuthorizeFollowService, RejectFollowService, RemoveStatusService * Add tests for BatchedRemoveStatusService * Deliver updates to a local account to ActivityPub followers * Minor adjustments
2017-06-12Fix regression from #3672 - Do not use pipeline around zscore (#3704)Eugen Rochko
2017-06-11Fix removal of status sending the original status to mentioned users instead ↵Eugen Rochko
of delete Salmon (#3672) * Fix removal of status sending the original status to mentioned users instead of delete Salmon, add test * Create remove_status_service_spec.rb
2017-04-06Fix wrong pubsub channel on public timelinesEugen Rochko
2017-04-06Fix notifications delivered to wrong pubsub channel, optimized ↵Eugen Rochko
RemoveStatusService, slightly optimized FanOutOnWriteService again
2017-04-05Replace calls to FeedManager#inline_render and #broadcastEugen Rochko
2017-02-22Fix #651 - Do not reinsert original status into all followers feedsEugen Rochko
upon un-reblogging. Check if the reblog was in the feed in the first place. It might have been filtered on distribution.
2017-02-12Deduplicate delete salmons (send only one per mentioned-account domain)Eugen Rochko
2017-02-11Make follow requests federateEugen Rochko
2017-02-02Cleaning up format of broadcast real-time messages, removingEugen Rochko
redis-backed "mentions" timeline as redundant (given notifications)
2017-01-07Fix #147 - Unreblogging will leave original status in feedsEugen Rochko
2016-12-18Removing external hub completely, fix #333 fixing digit-only hashtags,Eugen Rochko
removing web app capability from non-webapp pages
2016-12-06Improve suspend account serviceEugen Rochko
2016-11-29Fix trying to PuSH-publish updates of remote removalsEugen
2016-11-28Adding embedded PuSH serverEugen Rochko
2016-11-15Fix rubocop issues, introduce usage of frozen literal to improve performanceEugen Rochko
2016-11-09Status removal is broadcast to public/hashtag timelines tooEugen Rochko
2016-10-16Fix RemoveStatusService trying to send delete salmons on behalf of remote ↵Eugen Rochko
statuses
2016-10-14Fix remove status service sending salmonsEugen Rochko
2016-09-29Improve code styleEugen Rochko
2016-09-12Adding a notification stack for error messagesEugen Rochko
2016-09-12Send "delete" Salmons to remote mentioned accounts on status removalEugen Rochko
Fixes #27
2016-09-09Refactored generation of unique tags, URIs and object URLs into own classes,Eugen Rochko
as well as formatting of content
2016-09-05RemoveStatusService fleshed out, still doesn't send Salmon slaps thoughEugen Rochko
2016-09-04Handle delete Salmons, todo: clean up timelinesEugen Rochko