* Twitch Webhook Registration Fix
This fixes the broken twitch webhook registration. I previously added
the `to_json` when I was switching to using HTTParty and working through
WebMock. I apparently forgot to test this manually however after and
relied on the specs that had some baked in bad assumptions.
This removes the `to_json` and configures the mocking properly in the
spec setup.
I tested locally that this can now succesfully register for webhooks
with Twitch!
* Fix Webhook verification digesting as well, hardcode the specs for durability
* Refactor to use shorter digest method
* Add cache buster lines from Bens branch
* Change format of user preferred languages
* Make sure user language settings are set by default
* Add missing expect to the user spec
* Fix users/misc template
* Move existing languages to a constant
* Remove commented user code
* Move languages out of User model
* Update preferred languages accordingly to the available languages
* Set user estimated language only if the language is available
* Fix Portuguese spelling #2582
* Get a job created that can create a webhook subscription for a twitch user login
* Remove ngork url
* Refactor add store the access token in the cache
* Get a controller stood up to recieve the webhooks. Now they just need to be processed
* Get User columns added and got webhook controller bones working
* Update the webhook job to use the User
* Add a way for the User to input their Twitch User Name. Plus a linter fix
* Delay webhook registration when profile is updated
* Don't add _ in username
* Use String columns
* Quick fix and add some more requests specs
* Specs for the webhook job
* Get a show page Twitch Live Streams. Just a straight embed of the Twitch Everything Embed UI. Works surprisingly well responsively, and works on all screen sizes
* Fix Gemfile.lock from merge issues
* Add support for expired tokens and add spec
* Add secrets to webhook registration and clean up spec to remove token logic
* Verify webhook secret and spec it
* Add rake task to enqueue webhook registration for all Users. This can be used from Heroku Scheduler
* Update the lease seconds to be for 5 days
* Actually lets do 7 so we can refresh twice a week and try to make sure that we can always miss one
* Hijack the existing Twitch logo instead of making a duplicate one
* Remove comment and replace with log line
* Remove some white space
* Log to Airbrake when webhook errors occur
* Move to passing in an id instead of User object
* Extract logic from Job to Service object
* Capitilize in the view
* Move out of models and into services
* Remove letover stub
* Remove one usage of Faraday
* Use HTTParty for all the HTTP here
* Move estimating user language logic to a service object
* Call a service from a User#estimate_default_language!
* ActiveJob for estimating default user language
* Call ActiveJob from the User#estimate_default_language
* Handle nil user email when estimating default language
* Switch user.estimate_default_language_without_delay! to estimate_default_language! in specs
* Use better description for test
* Test for new profile_updated_at touches
* Touch profile_updated_at when removing an auth
* Touch profile_updated_at when authing w/ new social username
* Add specs for single article functionality
* Add single article functionality
* Use article_id instead of single_article_id
* Add published: true when querying for one article
* Use article_id in specs oops
* Switch from deprecated honeycomb-rails to honeycomb-beeline
* Improve error handling, tests and add refactoring
* Fix multiple fetching test and add one more
The test wasn't actually testing the correct behavior, because the class
by default force fetches. It worked because it wasn't reloading the user
from the database.
* Test that Honeycomb's client is doing its thing
* Use some defensive programming to avoid any possible problem during shutdown
* Fix typo
* Use the new API to add fields to the current measured event
* Use default instrumentation and add user info to event
* Replace user.email with user.username, less personal data around
* Use mocking instead of calling Honeycomb.init
* Freeze time before traveling
* Remove a flaky test dependent on rand
* Add basic tests for Analytics service
* User/Organization are always required
* Add some data to the test
* Use queries and date times
* Fix AnalyticsService interface in the controller
* s/HTTP_API_KEY/api-key
* Defend against nils and support datetime objects
* Update app/services/analytics_service.rb
Co-Authored-By: rhymes <rhymesete@gmail.com>
* Use SQL sum, not Rails sum
* Group average_read_time
* Use SQL, not Rails
* Use ISO date
* Fix specs
* Send new comment notification service + specs
* Call new comment notification service from the model
* Return to non-bang notifications create
* An ActiveJob for the new comment notifications
* Call comments notification ActiveJob from Notification
* Add spec for org reaction notification
* Add organization_id to notifications
* Add validations for user and org IDs
* Move comment json_data out of loop
* Use actual column names instead
* Add organization filters
* Remove extra text-align
* Add organization filtering
* Refactor to reduce complexity
* Add receiver argument to handle orgs
* Add has_many notifications for orgs
* Add follow notifications for orgs
* Add comment notifications for orgs
* Rename some tests for specificity
* Add mark org notifications as read functionality
* Add radix to parseInt
* Define json_data outside of loop
* Notify org followers of a new post as well
* Move test to proper location
* Add test for aggregated method
* Make send org reaction notification more readable
* Test the rest of the notification model
* Refactor tag adjustment spec
* Fix extra html
* Use name attribute
* Export comments
* Update copy
* Fix time-dependent test
* Remove reactions_count from the export
* Only select needed attributes from the DB
* Add the path of the commentable to the export
Comments are attached to something but from the export that is not easily identifiable. We add the "commentable_path" to give some context.
* Initial tag adjustments
* Finalize tag adjustments and tag adjustments controller
* Fix schema.rb
* Finalize tag removal logic
* Adjust edge cases/tests for tag adjustment moderation
* Adjust tag adjustments spec
* Add EditorConfig file for all editors
* Add article export service
* Add setting to request an export of all articles
* On the outside they are called posts
* Add articles exported email to mailer and service
* Refactor to one public method and test flags
* Trigger the export if it was requested and send the email
* Recreated migration file with generic export fields
* Rename fields and switch to a whitelist
* Refactor ArticleExportService into a more generic structure
* Rename articles_exported_email to export_email
* Fix notify mailer spec
* Rename Exporter::Exporter to Exporter::Service
* Remove commented out line
* Removed body_html, coordinates and updated_at from export
* Invert DJ config
* Update spec
* Use timezone aware datetime methods
* Use timezone aware date parse for GitHub issue tag
* Introduce a bit of chaos programming using Zonebie
Zonebie uses a random timezone to run tests, it's a really good way to see if the code is timezone dependent or not.
* Convert GitHub issue date as UTC
* Fix weird breakpoint top-nav issue
* Fix error handling when submitting blank note
* Change status closed to invalid
* Add ability to sort between status
* WIP
* Add working views for new report page
* Add mailer WIP
* Add MVP of new reports system
* Move collapse to the right & add show page link
* Fix buttons for index page
* Change collapse to collapse/expand
* Remove email functionality from new report
* Update copy of report abuse responses
* WIP of showing emails in reports
* Fix notes for user_role_service.rb
* Remove unused scripts from internal.html.erb
* Update tests for reports dashboard
* Add missing migration file
* Add finishing touches to reports dashboard
* Remove deprecated methods
* Update view with better timestamps
* Update and write new tests
* Add .codeclimate.yml
* Remove commented out editor thing
* Undo commented out code for recaptcha method
* Undo comment out code for development
* Use new comment path instead of old comment path
* Initial automatic cleanup with rubocop
* Fix syntax error introduced by rubocop
* Cleanup seeds file
* Cleanup lib folder
* Exclude bin folder because it contains auto generated files
* Make Rubocop a little bit more chatty
* Block length should not include comments in the count
* Cleanup config folder
* Cleanup specs
* Updated Rubocop version and generated a todo file
* Fix broken ArticlesApi spec
* Fix tests
* Restored rubocop pre-commit hook
* Add CSRF tags to welcome index page
* Clean up auth service code a bit
* Add analytics role to approved org org_admins
* Add toggle links for org admins with no posts
* Fix wrong role name and add test
* Adjust validation for user fields
* Add test for user_role_service
* Fix confusing boolean