1Password: Expose CreatedAt and UpdatedAt timestamps as DateTime on VaultItem#189
Conversation
Co-authored-by: detunized <245393+detunized@users.noreply.github.com>
detunized
left a comment
There was a problem hiding this comment.
The dates should be parsed and returned as a standard datetime object in.NET. It shouldn't be strings. make sure to verify and don't throw if the dates don't parse just in case they are garbage.
|
@copilot The dates should be parsed and returned as a standard datetime object in.NET. It shouldn't be strings. make sure to verify and don't throw if the dates don't parse just in case they are garbage. |
Co-authored-by: detunized <245393+detunized@users.noreply.github.com>
Updated in commit d39fde7. The properties now return
Implemented in commit d39fde7. The Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Make the DateTime properties non-nullable and rather use the default value. also move out the parsing from the model and JSON properties into the vault parsing code. make VaultItem.CreatedAt and UpdatedAt strings and parse later. json model should be as simple as possible and match the incoming format closely. |
… parse in VaultItem Co-authored-by: detunized <245393+detunized@users.noreply.github.com>
Updated in commit a704ffc. The implementation now:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
| public string Name => Overview.Title ?? ""; | ||
| public string Description => Overview.AdditionalInfo ?? ""; | ||
| public string Note => Details.Note ?? ""; | ||
| public DateTime CreatedAt => ParseDateTime(_itemInfo.CreatedAt); |
There was a problem hiding this comment.
@copilot add a backing field here and don't re-parse the date every time. make sure it is parsed once and then cached.
There was a problem hiding this comment.
Added in commit d573747. The properties now use backing fields _createdAt and _updatedAt with lazy initialization (??=) so dates are parsed once and then cached, consistent with other properties like _fields and _overview.
Co-authored-by: detunized <245393+detunized@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Summary
Optimized date handling with lazy initialization:
_createdAtand_updatedAtbacking fields_fields,_overview,_detailsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.