Skip to content

Drop "Unknown message" notification #11542

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

Merged
merged 1 commit into from
Aug 19, 2024
Merged

Conversation

agjohnson
Copy link
Contributor

@agjohnson agjohnson commented Aug 15, 2024

I had this fix sitting around, I hit this while trying to work on #11209

@agjohnson agjohnson requested a review from a team as a code owner August 15, 2024 00:33
@agjohnson agjohnson requested a review from humitos August 15, 2024 00:33
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

What happens now when the message doesn't exist?

I think this will cause issues in the API response because we will have invalid items and also we will need to write some code in the frontend to protect us against this case as well, right?

agjohnson added a commit to readthedocs/ext-theme that referenced this pull request Aug 16, 2024
If the message was not found on a notification, don't try to display
anything.

- Refs readthedocs/readthedocs.org#11542
@agjohnson
Copy link
Contributor Author

Ah yes, I forgot I did have some code stashed to guard against a null notification.message, it's minor.

A better design might have been for the notification to not return from the API at all, however this seems hard/maybe expensive with messages being a string lookup instead of database objects. However, this use case is minor and unlikely already. I don't think we need to be exact here on the implementation.

@marcin-pece

This comment was marked as spam.

@humitos
Copy link
Member

humitos commented Aug 19, 2024

A better design might have been for the notification to not return from the API at all

Yeah, this would be ideal 👍🏼

agjohnson added a commit to readthedocs/ext-theme that referenced this pull request Aug 19, 2024
If the message was not found on a notification, don't try to display
anything.

- Refs readthedocs/readthedocs.org#11542
@agjohnson agjohnson merged commit 970c383 into main Aug 19, 2024
8 checks passed
@agjohnson agjohnson deleted the agj/drop-missing-notification branch August 19, 2024 18:09
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.

Notifications: removing a message causes unwanted unknown message notification
3 participants