-
Notifications
You must be signed in to change notification settings - Fork 29
✨(frontend+backend) show per-thread message count badge in mailbox list #751
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
Open
nicolasaunai
wants to merge
1
commit into
suitenumerique:main
Choose a base branch
from
nicolasaunai:feature/thread-message-count-badge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: suitenumerique/messages
Length of output: 226
🏁 Script executed:
Repository: suitenumerique/messages
Length of output: 36523
🏁 Script executed:
Repository: suitenumerique/messages
Length of output: 262
🏁 Script executed:
Repository: suitenumerique/messages
Length of output: 21021
🏁 Script executed:
Repository: suitenumerique/messages
Length of output: 18819
🏁 Script executed:
Repository: suitenumerique/messages
Length of output: 228
🌐 Web query:
DRF read-only IntegerField missing attribute serialization AttributeError SkipField get_attribute💡 Result:
The AttributeError combined with SkipField in Django REST Framework (DRF) typically occurs during the serialization process when the framework attempts to access an attribute on an object that does not exist [1][2][3]. ### Why this happens In DRF, the
Field.get_attribute()method is responsible for retrieving the value for a field from the object instance [4][3]. To handle cases where an attribute might be missing (often due torequired=Falseor specific model states), DRF wraps the attribute access in a try-except block that catchesAttributeErrorandKeyError[1][2][3]. When such an exception is caught: 1. If the field is not required and has no default value, DRF raises aSkipFieldexception [1][3]. 2. TheSkipFieldexception is caught by the parent serializer, causing the field to be silently omitted from the serialized output [1][5][6]. If you are seeing this error, it often means thatget_attributeis encountering anAttributeErrorthat it interprets as "the field is missing," but it may actually be masking a legitimate error in your code (such as an incorrectly named field or a property that raises anAttributeErrorinternally) [1][2][7]. ### Common Causes and Solutions * Incorrect Source: Ensure thesourceargument on your serializer field correctly matches an attribute or method on your model instance [1][2]. If the path is wrong,get_attributewill fail to find it [1]. * Property Methods: If a@propertyon your model raises anAttributeErrorinternally, DRF may catch it and treat the field as missing [1][2]. Ensure your property logic is robust and does not raiseAttributeErrorfor expected null or missing states [7]. * Providing a Default: If you want the field to appear in the output even if the attribute access fails (e.g., returningNoneinstead of skipping the field), you can explicitly setdefault=Noneon the field [7]. This prevents the logic from reaching theSkipFieldpath [3]. * Debugging: Because this behavior suppresses the original traceback, it can be difficult to debug [1][2]. If you suspect the error is not simply a missing attribute, you can temporarily overrideget_attributeon your field to inspect the instance andsource_attrsdirectly, allowing you to see what is causing theAttributeError[5]. For more information, refer to the DRF documentation on serializer fields, specifically the behavior ofread_onlyfields andget_attribute[4].Citations:
🏁 Script executed:
Repository: suitenumerique/messages
Length of output: 2999
Populate
message_counton the split response.new_threadisn’t annotated here, so DRF will skip this field and the split payload will be missingmessage_countcompared with list/retrieve. Set it before serialization or switch to a serializer method with a fallback count.🤖 Prompt for AI Agents