General updates - #1099
Conversation
WalkthroughReplaces a Sentry scope callback in the application layout with a direct Changes
Sequence Diagram(s)sequenceDiagram
participant Server
participant Browser
participant SentryJS as Sentry (browser)
Note over Server,Browser: Old layout (embedded JS)
Server->>Browser: HTML with JS: Sentry.configureScope(callback => Sentry.setUser(...))
Browser->>SentryJS: configureScope invokes callback -> setUser executed
Note over Server,Browser: New layout (embedded JS)
Server->>Browser: HTML with JS: Sentry.setUser({ id: <json> })
Browser->>SentryJS: setUser called directly
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings, 1 inconclusive)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/views/layouts/application.html.erb (1)
34-34: Consider using.to_jsonfor safer Ruby-to-JavaScript interpolation.While the current approach works (user IDs are integers and the
'null'string outputs correctly as a JavaScript keyword), using.to_jsonis a more robust and idiomatic approach for interpolating Ruby values into JavaScript contexts.Apply this diff:
- Sentry.setUser({ id: <%= current_user&.id || 'null' %> }); + Sentry.setUser({ id: <%= current_user&.id.to_json %> });This handles the
nilcase automatically (outputs JavaScriptnull) and provides proper escaping for any edge cases.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/views/layouts/application.html.erb(1 hunks)db/migrate/20251026202155_remove_order_total_from_orders.rb(1 hunks)
🔇 Additional comments (1)
db/migrate/20251026202155_remove_order_total_from_orders.rb (1)
1-5: Migration is safe but missing column attributes for perfect reversibility.The column removal is safe because all codebase references to
order_totalwork through the method (defined inapp/models/order.rb:24-26), not direct column access. The method will continue calculating fromorder_rowsafter the column is removed. JSON serialization (orders_controller.rb), views (activities/show.html.erb), and JavaScript all call this method and will function correctly.For complete reversibility, consider updating the migration to include the column attributes:
remove_column :orders, :order_total, :decimal, precision: 8, scale: 2This matches the current schema definition (db/schema.rb:84) and ensures a clean rollback if needed.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## staging #1099 +/- ##
========================================
Coverage 74.56% 74.56%
========================================
Files 51 51
Lines 1093 1093
========================================
Hits 815 815
Misses 278 278 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Doing 2 different updates
Removing the orders_total colum because it is not used #1079
Fixing the configuration of Sentry
Switched to database consisty #984
update node version in dockerfile #996
Summary by CodeRabbit
Chores
Database Changes