Skip to content

Make trigger_reload return success/failure status#691

Draft
KaanOzkan wants to merge 1 commit intomainfrom
ko/reload-returns-result
Draft

Make trigger_reload return success/failure status#691
KaanOzkan wants to merge 1 commit intomainfrom
ko/reload-returns-result

Conversation

@KaanOzkan
Copy link
Contributor

Summary

Change reload from a fire-and-forget notification to a request that returns { success: true/false }. This allows callers (like the Tapioca addon) to know whether reload succeeded and skip DSL generation when it fails, instead of running against stale server state and producing incorrect RBIs.

Changes

  • server.rb: The reload handler now catches StandardError from Rails.application.reloader.reload! and returns { success: true } or { success: false } via send_result
  • runner_client.rb: trigger_reload uses make_request instead of send_notification, returning the result hash to callers

Testing

  • RED: reload handler sent no result — callers had no way to detect failure
  • GREEN: Returns { success: true } on success
  • All 45 existing tests pass (19 runner_client + 26 server)

Related

Change reload from a fire-and-forget notification to a request that
returns { success: true/false }. This allows callers (like the Tapioca
addon) to skip DSL generation when reload fails, instead of running
against stale server state.

Server: catch StandardError during reload!, return success status.
Client: use make_request instead of send_notification.

Related: Shopify/team-ruby-dx#1711
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant