taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 5f865e67394c00f8c462bb56119c20e3d1a08849
parent c66d8c7961b6686e8c71dfeca0137cabc4bad711
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Thu, 22 Oct 2026 07:54:54 +0200

mailbox/taldir: Remove unnecessary version field again. Rename client facing self field to isSelf to avoid keyword clash

Diffstat:
Mpackages/taler-util/src/types-taler-wallet.ts | 10++--------
Mpackages/taler-wallet-core/src/contacts.ts | 3+--
Mpackages/taler-wallet-core/src/db/indexeddb/transaction.ts | 4+---
Mpackages/taler-wallet-core/src/db/sqlite/schema.ts | 2--
Mpackages/taler-wallet-core/src/db/sqlite/transaction.ts | 11++++-------
5 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/packages/taler-util/src/types-taler-wallet.ts b/packages/taler-util/src/types-taler-wallet.ts @@ -1813,8 +1813,7 @@ export const codecForContactEntry = (): Codec<ContactEntry> => .property("aliasType", codecForString()) .property("mailboxBaseUrl", codecForString()) .property("mailboxAddress", codecForString()) - .property("self", codecOptional(codecForBoolean())) - .property("version", codecOptional(codecForNumber())) + .property("isSelf", codecOptional(codecForBoolean())) .property("source", codecForString()) .property("petname", codecForString()) .build("ContactListItem"); @@ -2253,12 +2252,7 @@ export interface ContactEntry { /** * Is this a self-contact? */ - self?: boolean; - - /** - * Version of the contact. - */ - version?: number; + isSelf?: boolean; /** * The source of this contact diff --git a/packages/taler-wallet-core/src/contacts.ts b/packages/taler-wallet-core/src/contacts.ts @@ -45,8 +45,7 @@ async function makeContactListItem( mailboxAddress: r.mailboxAddress, source: r.source, petname: r.petname, - self: r.self ?? false, - version: r.version ?? 0, + isSelf: r.isSelf ?? false, }; return listItem; } diff --git a/packages/taler-wallet-core/src/db/indexeddb/transaction.ts b/packages/taler-wallet-core/src/db/indexeddb/transaction.ts @@ -276,8 +276,7 @@ export class IdbWalletTransaction implements WalletDbTransaction { mailboxAddress: contact.mailboxAddress, source: contact.source, petname: contact.petname, - self: contact.self, - version: contact.version, + self: contact.isSelf, }); } @@ -297,7 +296,6 @@ export class IdbWalletTransaction implements WalletDbTransaction { source: r.source, petname: r.petname, self: r.self, - version: r.version, })); } diff --git a/packages/taler-wallet-core/src/db/sqlite/schema.ts b/packages/taler-wallet-core/src/db/sqlite/schema.ts @@ -357,7 +357,6 @@ CREATE TABLE IF NOT EXISTS contacts ( source TEXT NOT NULL, petname TEXT NOT NULL, self INTEGER DEFAULT 0, - version INTEGER DEFAULT 0, PRIMARY KEY (alias, alias_type) ); @@ -1526,7 +1525,6 @@ export const schemaMigrations: SchemaMigration[] = [ name: "contact-self-and-version", statements: [ "ALTER TABLE contacts ADD COLUMN self INTEGER DEFAULT 0", - "ALTER TABLE contacts ADD COLUMN version INTEGER DEFAULT 0", ], }, ]; diff --git a/packages/taler-wallet-core/src/db/sqlite/transaction.ts b/packages/taler-wallet-core/src/db/sqlite/transaction.ts @@ -4702,15 +4702,14 @@ export class SqliteWalletTransaction implements WalletDbTransaction { async addContact(contact: ContactEntry): Promise<void> { await this.run( `INSERT INTO contacts ( - alias, alias_type, mailbox_base_uri, mailbox_address, source, petname, self, version - ) VALUES ($alias, $type, $uri, $addr, $src, $pet, $self, $version) + alias, alias_type, mailbox_base_uri, mailbox_address, source, petname, self + ) VALUES ($alias, $type, $uri, $addr, $src, $pet, $self) ON CONFLICT(alias, alias_type) DO UPDATE SET mailbox_base_uri = excluded.mailbox_base_uri, mailbox_address = excluded.mailbox_address, source = excluded.source, petname = excluded.petname, - self = excluded.self, - version = excluded.version`, + self = excluded.self`, { alias: contact.alias, type: contact.aliasType, @@ -4718,8 +4717,7 @@ export class SqliteWalletTransaction implements WalletDbTransaction { addr: contact.mailboxAddress, src: contact.source, pet: contact.petname, - self: boolToDb(contact.self ?? false), - version: contact.version ?? 0, + self: boolToDb(contact.isSelf ?? false), }, ); } @@ -4741,7 +4739,6 @@ export class SqliteWalletTransaction implements WalletDbTransaction { source: str(row.source), petname: str(row.petname), self: dbToOptBool(row.self), - version: typeof row.version === "number" ? row.version : 0, })); }