fix: 🐛 Rename updateAt to updatedAt in Message model for consistency#26
Open
japanshah-simform wants to merge 1 commit into
Open
fix: 🐛 Rename updateAt to updatedAt in Message model for consistency#26japanshah-simform wants to merge 1 commit into
updateAt to updatedAt in Message model for consistency#26japanshah-simform wants to merge 1 commit into
Conversation
bbe3ebf to
2703ff7
Compare
There was a problem hiding this comment.
Pull request overview
Renames the Message model’s “last updated” timestamp API from updateAt to updatedAt for consistency, while attempting to preserve backwards compatibility via deprecations.
Changes:
- Added
updatedAtfield toMessage, with deprecatedupdateAtgetter/constructor/copyWith parameter mapping toupdatedAt. - Updated
Message.fromJson()to readupdated_atwith fallback to legacyupdate_at. - Added an Unreleased changelog entry describing the rename and JSON behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| lib/src/models/data_models/message.dart | Introduces updatedAt and updates JSON parsing/serialization + equality/hash behavior. |
| CHANGELOG.md | Documents the rename under an Unreleased entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
162
to
167
| if (includeNullValues) { | ||
| data[_replyMessage] = replyMessage.toJson(); | ||
| data[_reaction] = reaction.toJson(); | ||
| data[_voiceMessageDuration] = voiceMessageDuration?.inMicroseconds; | ||
| data[_updateAt] = updateAt?.toIso8601String(); | ||
| data[_updatedAt] = updatedAt?.toIso8601String(); | ||
| data[_update] = update; |
Comment on lines
+79
to
+81
| update: updateData is Map<String, dynamic> ? updateData : null, | ||
| updateAt: DateTime.tryParse(json[_updateAt].toString()), | ||
| updatedAt: DateTime.tryParse(json[_updatedAt]?.toString() ?? '') ?? | ||
| DateTime.tryParse(json[_updateAt].toString()), |
| 'Use updatedAt instead.', | ||
| ) | ||
| DateTime? updateAt, | ||
| Map<String, String>? update, |
Comment on lines
+3
to
+4
| * **Fix**: [26](https://github.com/SimformSolutionsPvtLtd/chatview_utils/pull/26) Renamed `updateAt` to `updatedAt` in `Message` model for | ||
| consistency. The deprecated `updateAt` getter is still available for backward compatibility but will be removed in a future version. `fromJson()` now reads from `updated_at` key and falls back to `update_at` key if not found. |
2703ff7 to
9cbf9a2
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.