-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(shared-views): Remove position usage in groupsearchview serializer #87367
base: master
Are you sure you want to change the base?
feat(shared-views): Remove position usage in groupsearchview serializer #87367
Conversation
user_id=request.user.id, | ||
group_search_view_id__in=[view.id for view in new_view_state], | ||
) | ||
last_visited_map = {lv.group_search_view_id: lv.last_visited for lv in last_visited_views} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line was the issue: I was sending over an entire GroupSearchViewLastVisited entry rather than just the last_visited timestamp, which was causing the serializability error.
@with_feature({"organizations:issue-stream-custom-views": True}) | ||
@with_feature({"organizations:global-views": True}) | ||
@freeze_time("2025-03-07T00:00:00Z") | ||
def test_response_with_last_visited(self) -> None: | ||
GroupSearchViewLastVisited.objects.create( | ||
user_id=self.user.id, | ||
organization=self.organization, | ||
group_search_view=self.base_data["user_one_views"][0], | ||
last_visited=timezone.now(), | ||
) | ||
|
||
views = self.client.get(self.url).data | ||
response = self.get_success_response(self.organization.slug, views=views) | ||
|
||
assert response.data[0]["lastVisited"] == timezone.now() | ||
assert response.data[1]["lastVisited"] is None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test correctly reproduced the error and now passes with the fix.
Fixes SENTRY-3QBN
Clone of #87297, but includes a fix in ed8c6fc that was causing some json serialization issues shown in the Sentry error above.