Conversation
- Create DataSync wrapper model to use the new types - Implement DataSync database table and queries in Android - Add db migration 30.sqm - Debug compile issue on “value” name - Fix db changing table argument names to sync_key and sync_value - Implement new adapters for DataSync - Implement DataSyncDboPresenterMapper
- Set build gradle configuration for DataSync module - Add DataSyncDboPresenterMapper on SphinxRepository to domain mapping - Implement DB queries using asFlow, mapToList, and mapToOneOrNull - Integrate DataSyncRepository on SphinxRepository inheritance - Implement getDataSyncByKeyAndIdentifier, upsertDataSync, deleteDataSync and deleteAllDataSync methods for DataSyncRepository - Apply distinctUntilChanged to DataSync flows to prevent not needed emissions
- Set build gradle configuration for DataSync module - Add DataSyncDboPresenterMapper on SphinxRepository to domain mapping - Implement DB queries using asFlow, mapToList, and mapToOneOrNull - Integrate DataSyncRepository on SphinxRepository inheritance - Implement getDataSyncByKeyAndIdentifier, upsertDataSync, deleteDataSync and deleteAllDataSync methods for DataSyncRepository - Apply distinctUntilChanged to DataSync flows to prevent not needed emissions - Review ConnectManager architecture pattern and understand how is injected on ViewModels - Create new concept module for Data Sync - Set build gradle configuration - Define DataSyncManager abstract class - Define DataSyncManagerListener interface for remote change callbacks - Create save methods for tip amount, private photo, timezone, feed status, feed item status - Implement callbacks:, onRemoteTipAmountChanged, onRemotePrivatePhotoChanged, onRemoteTimezoneChanged, onRemoteFeedStatusChanged, onRemoteFeedItemStatusChanged - Create feature-data-sync module for DataSyncManagerImpl - Set build gradle configuration - Move TimezoneSetting, FeedStatus, FeedItemStatus to wrapper-common for shared access - Implement JsonValueAdapter for Moshi - Create ItemsResponse and SettingItem data classes - Implement serialization helpers toJson and toOriginalFormatJson - Add state models DataSyncState and SyncStatus sealed classes - Implement notifyListenersOfRemoteChange
…ataSyncManagerImpl - Update AppModule to provide DataSyncManagerImpl - Implement getFileFromServer method using memeServerTokenHandler.retrieveAuthenticationToken - Implement token authentication flow with MediaHost.DEFAULT - Create DataSyncResponseDto and DataSyncItemDto data classes for network response - Add toJson() methods to dtos classes
…ture - Remove direct DataSyncRepository dependency from DataSyncManagerImpl - Add onSaveDataSyncItem callback to DataSyncManagerListener - Implement SynchronizedListenerHolder inner class - Replace direct repository calls in saveDataSyncItem with notifyListeners callback - Update SphinxRepository to implement new DataSyncManagerListener callback methods
- Update DataSyncManagerImpl to use DataSyncKey sealed class instead of SettingKey enum
- Add Flow collection for getAllDataSync to update DataSyncManager state - Implement dataSyncStateFlow observation to keep data synchronized with database
- Implement upsertDataSync to store DataSync on DB - Refactor JSON implementation - Change DataSyncItemDto.value type from Any to String - Update DataSyncResponseDto.toJson() to work with string values - Test string value storage in dataSyncDbo table
…sage - Get mnemonic from walletMnemonic and generate seed using mnemonicToSeed - Implement encryptDataSync and decryptDataSync methods in ConnectManagerImpl - Debug BadPaddingException error on decryption - Refactor DataSyncManagerListener interface to support suspend functions with return values - Create generic requestFromListener helper for suspend operations returning results - Add onEncryptDataSync and onDecryptDataSync suspend methods to DataSyncManagerListener - Update syncWithServer to call decryptValue for server data decryption - Test decrypt JSON string
…ver items - Implement encryptValue using listener callbacks - Create encrypted string from JSON using AES256JNCryptor - Implement uploadMergedDataToServer to encrypt and upload new actions - Fix convertTimestampToSeconds - Fix parseDate to return Long instead of Double - Test date format output on JSON string
…Manager interface - Add saveFeedStatus and saveFeedItemStatus in DataSyncManagerImpl with feedId identifier - Create mapToJsonString helper to construct JSON object - Fix JSON arguments for feed_status with chat_pubkey, feed_url, feed_id, subscribed, sats_per_minute, player_speed, item_id - Fix JSON for feed_item_status with duration, current_time - Add syncFeedSubscriptionStatus method in SphinxRepository - Implement toggleFeedSubscribeState to sync subscription changes - Get feed details and chat from db before syncing - Extract chatPubkey from chat.ownerPubKey - Call dataSyncManager.saveFeedStatus after updating subscription status - Update updateContentFeedStatus and updateContentEpisodeStatus to accept shouldSync - Call syncContentFeedStatus or syncContentEpisodeStatus when shouldSync is true - Add syncInitialFeedStatus method in PodcastPlayerViewModel - Add syncEpisodeStatusOnPause function in PodcastPlayerViewModel - Call syncEpisodeStatusOnPause in pauseEpisode - Implement syncEpisodeStatusOnSeek when user seek on the progress bar - Implement syncSatsPerMinuteChange in updateSatsPerMinute - Implement syncSpeedChange in adjustSpeed method - Test saveFeedStatus creates correct JSON format - Test feed_item_status updates
…imezone status on DB - Call get chat by Id to retrieve ownerPubKey for DataSync identifier - Call dataSyncManager.saveTimezoneForChat with pubKey, status, and identifier - Set empty string when timezone disabled - Implement updateTimezoneIdentifier to store timezone identifier - Implement TimezoneSetting.toJson extension for JSON serialization
- Implement applyItemToActualTables in DataSyncManagerImpl - Call applyItemToActualTables from applyMergedItemsToLocal for new and updated items - Create contactUpdateOwnerTipAmount, contactUpdateOwnerPrivatePhoto, contactUpdateOwnerAlias queries on sphinx database - Implement applyTipAmountSync and applyPrivatePhotoSync in SphinxRepository to save the data on contactDbo - Add parseLocalValue function to handle string and object values from DB - Create parseSimpleJsonObject helper for parsing JSON string values - Implement applyTimezoneSync and update timezone - Implement applyFeedStatusSync with contentFeedStatusUpdateFromSync when server data changes - Implement applyFeedItemStatusSync with contentEpisodeStatusGetByFeedAndItem - Create dummy contact with tip_amount and private_photo
- Replace exception-based flow collection pattern with filterNotNull().firstOrNull() This eliminates expensive stack trace generation from throwing exceptions for control flow and removes arbitrary delays - Replace runBlocking with withContext(io) in sendMessage() Prevents blocking the main thread during database transactions - Fix inconsistent lock ordering (chatLock -> messageLock) Ensures consistent lock acquisition order to prevent potential deadlocks Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Medium priority fixes: - Reuse Moshi adapter for ChapterResponseDto instead of creating new instances - Replace O(n²) nested loops with Map-based O(1) lookups in feed/episode mapping - Add bounded LRU caches (500 for msgSenderCache, 100 for Flow caches) Low priority fixes: - Replace Timer with coroutine delay to avoid unnecessary thread creation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add 16 missing indexes on frequently queried columns: Contact table: - idx_contact_node_pub_key: Faster contact lookups by pub key - idx_contact_owner: Faster owner contact queries - idx_contact_blocked: Faster blocked status filtering Message table: - idx_message_payment_hash: Faster Lightning payment lookups - idx_message_tag: Faster message tag updates - idx_message_chat_sender_seen: Better composite index for unseen counts Feed table: - idx_feed_chat_id: Faster feed lookups by chat - idx_feed_type: Faster feed type filtering - idx_feed_subscribed: Faster subscription queries Feed item table: - idx_feed_item_feed_id: Faster episode lookups Other tables: - idx_invite_contact_id: Faster invite lookups - idx_lsat_issuer, idx_lsat_status: Faster LSAT queries - idx_subscription_contact_id, idx_subscription_chat_id: Faster subscription queries - idx_dashboard_include_return: Faster dashboard pagination All indexes use IF NOT EXISTS for backward compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… normal call since a encryption string is returned instead a JSON - Remove serverItem logs - Implement endpoint and get encrypted string from macOS client - Parse JSON, compare and store new values locally
…ocess - Analyze and discuss getFromFileServer error case (empty file server = network fails) - Implement uploadDataSyncFile network call - Init owner on dashboard view model to fetch it on dataSyncManager - Change build gradle to make the SyncManager an Android module to import utils - Process owner pubkey using hexToBase64URL - Add syncWithServer method with mutex lock for thread safety - Implement onClearDataSyncTable when data was updated successfully
- Debug timezone sync problem - Handle JSON parameters underscore and camel case - Debug feed sync issue - Modify applyFeedStatusSync and call contentFeedStatusUpsert - Test subscribe podcast and android fetching
- Call syncWithServer on DashboardViewModel (taking the app init strarting point from here) - Implement sync data when app is coming from background - Upsert actual db values with server JSON - Test tip_amount changed on macOS and sync on Android (app init and app foreground) - Test timezone changed - Test subscribe to new podcast
…before storing on db - Modify syncWithServer to accept optional pendingDataSync - Update syncWithServerInternal to include pendingDataSync in localDataSync list - Update saveDataSyncItem to create DataSync object and pass it to syncWithServer - Debug timezone identifier saving empty string in JSON - Remove dataSyncManager.saveTimezoneForChat from updateTimezoneEnabledStatus
- Solve conflicts with SphinxDatabase and migration - Solve conflicts on SphinxRepository
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.