about summary refs log tree commit diff
path: root/spec/services
AgeCommit message (Collapse)Author
2017-05-05More robust PuSH subscription refreshes (#2799)Eugen Rochko
* Fix #2473 - Use sidekiq scheduler to refresh PuSH subscriptions instead of cron Fix an issue where / in domain would raise exception in TagManager#normalize_domain PuSH subscriptions refresh done in a round-robin way to avoid hammering a single server's hub in sequence. Correct handling of failures/retries through Sidekiq (see also #2613). Optimize Account#with_followers scope. Also, since subscriptions are now delegated to Sidekiq jobs, an uncaught exception will not stop the entire refreshing operation halfway through Fix #2702 - Correct user agent header on outgoing http requests * Add test for SubscribeService * Extract #expiring_accounts into method * Make mastodon:push:refresh no-op * Queues are now defined in sidekiq.yml * Queues are now in sidekiq.yml
2017-05-04Delete records in smaller transaction (#2802)alpaca-tc
2017-05-04Likely fix #2458, fix #2031 - handle out-of-order deletes for statuses (#2734)Eugen Rochko
* Likely fix #2458, fix #2031 - handle out-of-order deletes for statuses If a delete arrives before the original status, cache that information for 6h, and if the original status arrives in that window, ignore it * Add test case
2017-05-03Additional specs for URI handling (#2759)ThibG
2017-05-02Add rspec to further specify FollowRemoteAccountService (#2414)ThibG
2017-04-29Set correct attachment type for rejected media (#2599)Patrick Figel
In #2110, a new attachment type "unknown" was introduced for attachments that were rejected due to a domain being blocked using reject_media. However, the "type" field was never set to "unknown" because a default value of "0" (image) is set for that column, causing the `type.blank?` expression to always equal false. This version uses type_changed? instead, causing the type to be set to "unknown" unless a type has been explicitly set. This introduces a small change in behaviour causing the type to be set to unknown before paperclip calls `before_post_process`. Presumably this behaviour is more appropriate than the current one because the attachment type has not been determined by that point. Included are new tests for `ProcessFeedService` and `UpdateRemoteProfileService` which now check that remote media is downloaded for non-blocked domains and is rejected for others.
2017-04-27Improve shared status verification (#2525)Eugen Rochko
* Instead of parsing shared status contents verbatim, make roundtrip to purported original URL. Confirm that the "original" URL is from the same domain as the author it claims to be from. * Fix obvious typo, add comment * Use URI look-up first * Add test, update Goldfinger dependency to make less useless HTTP requests per Webfinger lookup
2017-04-27OEmbed support for PreviewCard (#2337)Eugen Rochko
* OEmbed support for PreviewCard * Improve ProviderDiscovery code failure treatment * Do not crawl links if there is a content warning, since those don't display a link card anyway * Reset db schema * Fresh migrate * Fix rubocop style issues Fix #1681 - return existing access token when applicable instead of creating new * Fix test * Extract http client to helper * Improve oembed controller
2017-04-26Domain block service cleanup (#2490)Matt Jankowski
* Add coverage for domain block service with silence * Get rid of warning about find_each and order * Move domain_block to attr_reader * Move optional clear_media into silence_accounts method * Use blocked_domain method to reduce passed vars * Extract blocked_domain_accounts method to find accounts on the domain * Extract media_from_blocked_domain method to find relevant attachments * Separate destruction of account images and account attachments
2017-04-25Fix #2402 - Add Idempotency-Key header to PostStatusService that prevents ↵Eugen Rochko
(#2419) duplicates. Web UI regenerates UUID for that header every time the compose form is changed or successfully submitted Also, fix Farsi i18n overwriting the English one
2017-04-25Optimize account search (#2421)178inaba
2017-04-25Punycode URI normalization (#2370)Eugen
* Fix #2119 - Whenever about to send a HTTP request, normalize the URI * Add test for IDN request in FetchLinkCardService * Perform IDN normalization on domains before they are stored in the DB
2017-04-19Fix possibility of unrightful webfinger redirect (#2147)Eugen
* Fix possibility of unrightful webfinger redirect * Add more tests for FollowRemoteAccountService
2017-04-18Language detection refactor (#2099)Matt Jankowski
* Extract detect_language to separate class * Use default locale, not just en * Add spec to confirm that whatlanguage cant identify empty string * Allow account locale to override default in language detector * PostStatusService supplies an account to detect language
2017-04-17Fix nil query_username (#2013)Tomohiro Suwa
2017-04-15Account search service refactor (#1791)Matt Jankowski
* Begin coverage for account search service * Coverage for hashtag query * Coverage for calling local vs remote find based on domain presence * Spec to check that exact matches are not duped * Coverage of resolve option * Coverage for account being provided * Start to refactor account search service * Isolate query username and domain methods * Isolate exact_match method * Extract methods for local and remote results * Simplify local vs remote and account isoliation * Extract methods for local and remote results * Simplify de-dupe of exact match * Simplify logic to check for non exact remotes * Cache some methods * Remove nil from exact_match from results array * Return exact matches first * Use find_remote even with no domain Account.find_local is just an alias for Account.find_remote(user, nil) - so we can not bother with the conditional here, and call find_remote directly.
2017-04-08Fix #1141, fix #1126 - Avatar/profile info fetching (#1215)Eugen
* Fix #1141, fix #1126 - Work through UpdateRemoteProfileService for both <feed> and <entry> top-level tags * Improve code quality, remove line unrelated to fix
2017-04-07Use I18n for media attachment validation errorsChad Pytel
These are currently user facing errors, but are not localized. This adds the ability for these messages to be localized.
2017-04-07Add specs for PostStatusServiceChad Pytel
This implements all pending specs, and adds additional coverage for the following functionality: * Normal status creation * Creating a reply status * Creating a sensitive status * Creating a status with spoiler text * A status with no spoiler text gets an empty string for spoiler text * Creating a status with custom visibility * Creating a status for an application * Processing mentions * Processing Hashtags * Pinging PuSH hubs * Crawling links * Attaching media
2017-04-07Add specs for media attachment validationsChad Pytel
There are currently not specs for the two media validations that are performed by `PostStatusService`. This adds specs for the validations that ensure that you cannot attach more than four files, and that a status cannot have both image and video attachments.
2017-04-05Split SalmonWorker into smaller parts, move profile updating into another jobEugen Rochko
2017-04-04Quick attempt to get pull requests passingKurtis Rainbolt-Greene
2017-04-03Add basic logging of who resolved reportEugen Rochko
2017-03-01Mute button progress so far. WIP, doesn't entirely work correctly.Kit Redgrave
2017-02-12Adding more unit tests. Fixing Salmon slaps XMLEugen Rochko
2017-02-12Stop trying to shoehorn all Salmon updates into the poor database-connectedEugen Rochko
StreamEntry model. Simply render Salmon slaps as they are needed
2017-02-02Cleaning up format of broadcast real-time messages, removingEugen Rochko
redis-backed "mentions" timeline as redundant (given notifications)
2017-01-23Domain blocks now have varying severity - auto-suspend vs auto-silenceEugen Rochko
2016-12-18Removing external hub completely, fix #333 fixing digit-only hashtags,Eugen Rochko
removing web app capability from non-webapp pages
2016-11-26Update hub URL and re-subscribe if hub URL changesEugen Rochko
2016-11-18Fix OAuth authorization page and add a spec for itEugen Rochko
2016-11-12Upgrade ruby to 2.3.1Eugen Rochko
2016-11-06Add test for FanOutOnWriteServiceEugen Rochko
2016-10-10Adding test for ProcessFeedServiceEugen Rochko
2016-10-09Adding domain blocksEugen Rochko
2016-10-03API for blocking and unblockingEugen Rochko
2016-09-26Fix #54 - Fetch remote accounts by URL from mentionsEugen Rochko
Fetching atom extracted from FetchRemoteAccountService and FetchRemoteStatusService into FetchAtomService. Mentions of the constant "http://activityschema.org/collection/public" skipped as it's not a real URL/user.
2016-09-18Fix #43Eugen Rochko
2016-03-22Only re-download avatar if URL changed (fix #19)Eugen Rochko
2016-03-19Adding more test stubsEugen Rochko
2016-03-18Removing autogenerated test stubs that were not neededEugen Rochko
2016-03-05Fixing some bugs, adding pending test examplesEugen Rochko
2016-02-29Changing the use of config constants to the Rails configuration objectEugen Rochko
2016-02-28Adding a test for ReblogService, fixing mentions for remote statusesEugen Rochko
2016-02-25Adding a Mention model, test stubsEugen Rochko