Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup(ex/db/detour): remove state_value #2965

Merged
merged 6 commits into from
Mar 4, 2025

Conversation

firestack
Copy link
Member

@firestack firestack commented Feb 18, 2025

PR for :state_value removal thread #2961 (comment)

@firestack firestack requested a review from bfauble February 18, 2025 17:17
@firestack firestack marked this pull request as ready for review February 18, 2025 17:17
@firestack firestack requested a review from a team as a code owner February 18, 2025 17:17
Base automatically changed from bf-query-with-status-field to main February 18, 2025 18:55
Copy link
Contributor

@bfauble bfauble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if possible can we try to remove any calls to categorize_detour that aren't happening before an update/create in the DB?

https://github.com/mbta/skate/blob/main/lib/skate/detours/detours.ex#L242
https://github.com/mbta/skate/blob/main/lib/skate/detours/detours.ex#L362

These should be able to just reference the status field instead of needing to calculate from the state.

Then I think we can move the logic of this function to the add_status function used within the Detour.changeset here: https://github.com/mbta/skate/blob/main/lib/skate/detours/db/detour.ex#L65 since any status updates I believe should be persisted and subsequently updated in the status field and available for use wherever needed either in a return response or side effect branching and would limit the surface area for state/prop consistency issue that could arise

@firestack
Copy link
Member Author

if possible can we try to remove any calls to categorize_detour that aren't happening before an update/create in the DB?

Sure yeah! I'd prefer to have that in it's own PR, as this should only be concerned with the :state_value IMO.

See #2967

@firestack firestack force-pushed the kf/refactor/remove-state-value branch from fc2ec51 to ef2c6bf Compare February 28, 2025 21:09
@firestack firestack merged commit 6fee170 into main Mar 4, 2025
15 checks passed
@firestack firestack deleted the kf/refactor/remove-state-value branch March 4, 2025 18:43
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.

2 participants