chore: enforce lint across codebase and ban "maybe" in identifiers
Remove member-ordering and complexity eslint-disable comments by reordering class members and applying targeted fixes. Add metoyou/no-maybe-in-naming, type-safe WebRTC e2e harness helpers, and resolve remaining lint errors so npm run lint exits cleanly. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -51,11 +51,11 @@ export class CapacitorMobileNotificationsAdapter implements MobileNotificationAd
|
||||
types: [
|
||||
{
|
||||
id: 'INCOMING_CALL_ACTIONS',
|
||||
actions: [{ id: 'answer', title: mobileLabel('mobile.notifications.answer') }, { id: 'hangup', title: mobileLabel('mobile.notifications.decline') }]
|
||||
actions: this.incomingCallNotificationActions()
|
||||
},
|
||||
{
|
||||
id: 'ACTIVE_CALL_ACTIONS',
|
||||
actions: [{ id: 'mute', title: mobileLabel('mobile.notifications.mute') }, { id: 'hangup', title: mobileLabel('mobile.notifications.hangUp') }]
|
||||
actions: this.activeCallNotificationActions()
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -161,4 +161,18 @@ export class CapacitorMobileNotificationsAdapter implements MobileNotificationAd
|
||||
onActionSelected(handler: (input: { callId: string; intent: CallNotificationActionIntent }) => void): void {
|
||||
this.actionHandler = handler;
|
||||
}
|
||||
|
||||
private incomingCallNotificationActions() {
|
||||
const answerAction = { id: 'answer', title: mobileLabel('mobile.notifications.answer') };
|
||||
const hangupAction = { id: 'hangup', title: mobileLabel('mobile.notifications.decline') };
|
||||
|
||||
return [answerAction, hangupAction];
|
||||
}
|
||||
|
||||
private activeCallNotificationActions() {
|
||||
const muteAction = { id: 'mute', title: mobileLabel('mobile.notifications.mute') };
|
||||
const hangupAction = { id: 'hangup', title: mobileLabel('mobile.notifications.hangUp') };
|
||||
|
||||
return [muteAction, hangupAction];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,14 +8,15 @@ import { MobileSqliteConnectionService } from '../../services/mobile-sqlite-conn
|
||||
* Domain persistence routes through {@link CapacitorDatabaseService} on Capacitor shells.
|
||||
*/
|
||||
export class CapacitorMobilePersistenceAdapter implements MobilePersistenceAdapter {
|
||||
private initialized = false;
|
||||
|
||||
constructor(private readonly connection: MobileSqliteConnectionService) {}
|
||||
|
||||
get isNativeSqlite(): boolean {
|
||||
return this.connection.isAvailable;
|
||||
}
|
||||
|
||||
private initialized = false;
|
||||
|
||||
constructor(private readonly connection: MobileSqliteConnectionService) {}
|
||||
|
||||
async initialize(): Promise<void> {
|
||||
if (this.initialized) {
|
||||
return;
|
||||
@@ -32,4 +33,5 @@ export class CapacitorMobilePersistenceAdapter implements MobilePersistenceAdapt
|
||||
this.initialized = true;
|
||||
console.info('[mobile] native SQLite persistence initialized');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -137,7 +137,8 @@ const SCHEMA_V2_MESSAGE_COLUMNS = [
|
||||
'ALTER TABLE messages ADD COLUMN kind TEXT',
|
||||
'ALTER TABLE messages ADD COLUMN systemEvent TEXT'
|
||||
];
|
||||
const SCHEMA_V3_MESSAGE_COLUMNS = ['ALTER TABLE messages ADD COLUMN revision INTEGER NOT NULL DEFAULT 0', 'ALTER TABLE messages ADD COLUMN headHash TEXT'];
|
||||
const SCHEMA_V3_REVISION_COLUMN = 'ALTER TABLE messages ADD COLUMN revision INTEGER NOT NULL DEFAULT 0';
|
||||
const SCHEMA_V3_HEAD_HASH_COLUMN = 'ALTER TABLE messages ADD COLUMN headHash TEXT';
|
||||
|
||||
/** Returns DDL statements that still need to run for the stored schema version. */
|
||||
export function resolveMobileSqliteMigrationStatements(storedVersion: number): string[] {
|
||||
@@ -157,7 +158,7 @@ export function resolveMobileSqliteMigrationStatements(storedVersion: number): s
|
||||
}
|
||||
|
||||
if (storedVersion < 3) {
|
||||
statements.push(...SCHEMA_V3_MESSAGE_COLUMNS);
|
||||
statements.push(SCHEMA_V3_REVISION_COLUMN, SCHEMA_V3_HEAD_HASH_COLUMN);
|
||||
statements.push(`INSERT OR REPLACE INTO meta (key, value) VALUES ('${META_SCHEMA_VERSION_KEY}', '3')`);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,17 +22,22 @@ const DEFAULT_POLL_INTERVAL_MS = 30 * 60_000;
|
||||
export class MobileAppUpdateService {
|
||||
readonly state = signal<MobileUpdateState>(createInitialMobileUpdateState());
|
||||
|
||||
private readonly appI18n = inject(AppI18nService);
|
||||
private readonly mobilePlatform = inject(MobilePlatformService);
|
||||
private adapter: MobileAppUpdateAdapter = new WebMobileAppUpdateAdapter();
|
||||
private adapterReady: Promise<MobileAppUpdateAdapter> | null = null;
|
||||
private initialized = false;
|
||||
private pollTimerId: number | null = null;
|
||||
|
||||
get isCapacitor(): boolean {
|
||||
return this.mobilePlatform.isCapacitor();
|
||||
}
|
||||
|
||||
private readonly appI18n = inject(AppI18nService);
|
||||
|
||||
private readonly mobilePlatform = inject(MobilePlatformService);
|
||||
|
||||
private adapter: MobileAppUpdateAdapter = new WebMobileAppUpdateAdapter();
|
||||
|
||||
private adapterReady: Promise<MobileAppUpdateAdapter> | null = null;
|
||||
|
||||
private initialized = false;
|
||||
|
||||
private pollTimerId: number | null = null;
|
||||
|
||||
async initialize(): Promise<void> {
|
||||
if (this.initialized) {
|
||||
return;
|
||||
@@ -170,4 +175,5 @@ export class MobileAppUpdateService {
|
||||
void this.checkForUpdates();
|
||||
}, DEFAULT_POLL_INTERVAL_MS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,15 +9,19 @@ import { MobileSqliteConnectionService } from './mobile-sqlite-connection.servic
|
||||
/** Facade for native SQLite persistence on mobile shells. */
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class MobilePersistenceService {
|
||||
private readonly mobilePlatform = inject(MobilePlatformService);
|
||||
private readonly sqliteConnection = inject(MobileSqliteConnectionService);
|
||||
private adapter: MobilePersistenceAdapter = new WebMobilePersistenceAdapter();
|
||||
private adapterReady: Promise<MobilePersistenceAdapter> | null = null;
|
||||
|
||||
get isNativeSqlite(): boolean {
|
||||
return this.adapter.isNativeSqlite;
|
||||
}
|
||||
|
||||
private readonly mobilePlatform = inject(MobilePlatformService);
|
||||
|
||||
private readonly sqliteConnection = inject(MobileSqliteConnectionService);
|
||||
|
||||
private adapter: MobilePersistenceAdapter = new WebMobilePersistenceAdapter();
|
||||
|
||||
private adapterReady: Promise<MobilePersistenceAdapter> | null = null;
|
||||
|
||||
initialize(): Promise<void> {
|
||||
return this.ensureAdapter().then((adapter) => adapter.initialize());
|
||||
}
|
||||
@@ -40,4 +44,5 @@ export class MobilePersistenceService {
|
||||
|
||||
return this.adapterReady;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,15 +7,19 @@ import { getStoredCurrentUserId } from '../../../core/storage/current-user-stora
|
||||
/** Shared native SQLite connection used by mobile persistence and DatabaseService. */
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class MobileSqliteConnectionService {
|
||||
private store: MobileSqliteStore | null = null;
|
||||
private activeDatabaseName: string | null = null;
|
||||
private initializationPromise: Promise<MobileSqliteStore | null> | null = null;
|
||||
private initializationFailed = false;
|
||||
|
||||
get isAvailable(): boolean {
|
||||
return this.store?.isAvailable === true;
|
||||
}
|
||||
|
||||
private store: MobileSqliteStore | null = null;
|
||||
|
||||
private activeDatabaseName: string | null = null;
|
||||
|
||||
private initializationPromise: Promise<MobileSqliteStore | null> | null = null;
|
||||
|
||||
private initializationFailed = false;
|
||||
|
||||
async initialize(): Promise<MobileSqliteStore | null> {
|
||||
if (this.initializationFailed) {
|
||||
return null;
|
||||
@@ -66,4 +70,5 @@ export class MobileSqliteConnectionService {
|
||||
|
||||
return this.store;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user