Add address book data service#37
Conversation
RecordTransferAsync loaded the contact via a NoTracking query (global QueryTrackingBehavior.NoTracking), so mutating LastUsedAt/TransferCount/ LastTransactionHash on the detached entity was silently dropped by SaveChangesAsync. Attach the entity as Modified so the update persists.
…core # Conflicts: # OneGateApp/Properties/Strings.resx # OneGateApp/Properties/Strings.zh-Hans.resx # OneGateApp/Properties/Strings.zh-Hant.resx
Per review, we do not store transaction records locally (online access only): remove the ContactTransfer table/entity, the transfer-tracking Contact columns (LastUsedAt/TransferCount/LastTransactionHash), RecordTransferAsync/GetTransfersAsync, and the related strings. The address book keeps address/label/note + suggestions/search.
|
Erik's note about not storing transaction records locally is handled in the current branch state. Audit check:
Previously posted validation for this PR includes Android and iOS simulator screenshots/build checks. |
|
conflicts |
|
Maintenance update after review audit:
Validation:
Screenshots: |
There was a problem hiding this comment.
Pull request overview
This PR extracts the address-book data/service foundation by extending the Contact model, adding an address-book oriented service layer, and wiring up a lightweight idempotent SQLite schema update plus supporting localized resources.
Changes:
- Added
AddressBookServicefor address normalization, label availability checks, entry lookup, and suggestion generation. - Extended
ContactwithNote,IsAddressBookEntry, and UI-friendly computed properties (display name, avatar text, short address, badge/detail text). - Added startup-time schema migration helpers to add new contact columns, registered the service, and updated string resources.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| OneGateApp/Services/AddressBookService.cs | New address book service (normalize/resolve address, label availability, entry listing/suggestions). |
| OneGateApp/Data/Contact.cs | Adds note/address-book metadata and computed display helpers. |
| OneGateApp/Data/ApplicationDbContext.cs | Adds idempotent schema migration helper to add Note/IsAddressBookEntry columns. |
| OneGateApp/App.xaml.cs | Ensures migrations run on app startup. |
| OneGateApp/MauiProgram.cs | Registers AddressBookService with DI. |
| OneGateApp/Properties/Strings*.resx | Adds new UI strings (note/search/recent recipient/label exists) and reorders Transfer in some locales. |
| OneGateApp/Properties/Strings.Designer.cs | Updates generated strongly-typed resource accessors for new keys. |
Files not reviewed (1)
- OneGateApp/Properties/Strings.Designer.cs: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Review feedback update:
Validation:
Screenshots:
|
…core # Conflicts: # OneGateApp/Properties/Strings.Designer.cs
|
Conflict refresh after latest
|
…core # Conflicts: # OneGateApp/Properties/Strings.Designer.cs
|
Base refresh validation update:
Screenshots are stored as GitHub release assets only, not committed to the repo: |
…core # Conflicts: # OneGateApp/Properties/Strings.Designer.cs
|
Base refresh validation update:
Screenshots are stored as GitHub release assets only, not committed to the repo: |


Purpose
Split out the address-book data/service foundation from the larger address-book work so it can be reviewed independently.
Scope
NoteandIsAddressBookEntry.Contactwith note/address-book metadata and display helpers.AddressBookServicefor Neo address normalization, label resolution, label availability checks, contact lookup, and contact suggestions.Out of scope
Validation
xmllint --noout OneGateApp/Properties/Strings.resx OneGateApp/Properties/Strings.zh-Hans.resx OneGateApp/Properties/Strings.zh-Hant.resxgit diff --checkMD_APPLE_SDK_ROOT=/Applications/Xcode-26.5.0.app dotnet build OneGateApp/OneGateApp.csproj -f net10.0-ios -p:RuntimeIdentifier=iossimulator-arm64 -p:EnableCodeSigning=false -p:CodesignKey= -p:CodesignProvision= -p:ProvisioningType=automaticKnown existing warnings remain: SQLitePCLRaw
NU1903and iOS asset duplicateMT7158.