Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 15, 2025

This PR implements the requested feature to display the last sync time in both the settings page and the generated markdown files.

Changes Made

Data Storage

  • Added LAST_SYNC_TIME preference to AppPreferenceDataStore using Long type to store Unix timestamps
  • Added getLastSyncTime flow that defaults to 0L (representing "never synced")
  • Added setLastSyncTime(timestamp) method for updating the sync time

Sync Logic

  • Enhanced SyncRepository interface with recordSyncTime() method
  • Updated SyncRepositoryImpl to record timestamps only on successful sync completion
  • Modified markdown generation to include sync time in both comment headers and visible content:
    <!-- Last Synced: 2025-09-15 03:13:24 -->
    # Deeplinks
    
    **Last Sync:** 2025-09-15 03:13:24

User Interface

  • Added last sync time display to settings page with proper formatting ("Sep 15, 2025 at 03:13")
  • Shows "Never synced" when no sync has occurred yet
  • Last sync section is only visible when sync feature is enabled
  • Uses InfoCircle icon for visual consistency

State Management

  • Exposed lastSyncTime StateFlow in AccountViewModel
  • Integrated with existing sync state management patterns

Localization

  • Added appropriate string resources for last sync time display

Behavior

  • Fresh installations show "Never synced" until first successful sync
  • Sync failures don't update the last sync time
  • Timestamp persists across app restarts
  • Uses system default locale and timezone for formatting
  • Only successful syncs update the timestamp, ensuring accuracy

The implementation follows the existing codebase patterns and maintains backward compatibility while providing users with clear visibility into when their deeplinks were last synchronized.

Fixes #80.

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:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d/gradle-8.13/lib/gradle-daemon-main-8.13.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d/gradle-8.13/lib/agents/gradle-instrumentation-agent-8.13.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.13 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Add last sync time to markdown file Add last sync time to settings page and markdown file Sep 15, 2025
@Copilot Copilot AI requested a review from yogeshpaliyal September 15, 2025 03:15
Copilot finished work on behalf of yogeshpaliyal September 15, 2025 03:15
@yogeshpaliyal yogeshpaliyal marked this pull request as ready for review September 15, 2025 04:02
@yogeshpaliyal yogeshpaliyal merged commit 5144d2b into master Sep 15, 2025
1 check passed
@yogeshpaliyal yogeshpaliyal deleted the copilot/fix-80 branch September 15, 2025 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add last sync time to markdown file
2 participants