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

feat(view-sharing): Double write position to new table in PUT endpoint #86153

Merged
merged 2 commits into from
Mar 1, 2025

Conversation

MichaelSun48
Copy link
Member

This PR updates the PUT /group-search-views/ endpoint to double write the positions parameter to the new table created in this PR. This is necessary to ensure the tables stay in sync before backfilling.

@MichaelSun48 MichaelSun48 requested a review from a team as a code owner February 28, 2025 22:34
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 28, 2025
Comment on lines +186 to +193
starred_views = GroupSearchViewStarred.objects.filter(
organization=self.organization, user_id=self.user.id
)
assert len(starred_views) == len(response.data)
for idx, view in enumerate(response.data):
assert starred_views[idx].position == idx
assert starred_views[idx].position == view["position"]
assert str(starred_views[idx].group_search_view.id) == view["id"]
Copy link
Member Author

Choose a reason for hiding this comment

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

I just augmented the old tests to ensure the new entries were being created.

Double checking for both the enumeration index and view position (lines 191-192) is a little unnecessary, but just a sanity check.

@MichaelSun48 MichaelSun48 merged commit e361d89 into master Mar 1, 2025
49 checks passed
@MichaelSun48 MichaelSun48 deleted the msun/sharedViews/backfillOldPositions branch March 1, 2025 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants