Skip to content

feat: add auto-refresh polling for memo feeds#5348

Closed
AobaIwaki123 wants to merge 3 commits intousememos:mainfrom
AobaIwaki123:auto-refresh
Closed

feat: add auto-refresh polling for memo feeds#5348
AobaIwaki123 wants to merge 3 commits intousememos:mainfrom
AobaIwaki123:auto-refresh

Conversation

@AobaIwaki123
Copy link
Copy Markdown

@AobaIwaki123 AobaIwaki123 commented Dec 14, 2025

Summary

Add auto-refresh functionality for memo feeds.
Polls for new memos at a user-configured interval and automatically refreshes the list when updates are detected.

Tip

If you'd like to try this feature before the official release, pre-built Docker images are available at iwakiaoba/aoba-memos on Docker Hub.


Architecture

sequenceDiagram
    participant Hook as useAutoRefresh
    participant API as MemoService
    participant List as PagedMemoList
    
    loop Every interval (when visible & online)
        Hook->>API: ListMemos (pageSize=1)
        API-->>Hook: Latest memo
        alt New memo detected
            Hook->>List: onRefresh()
        end
    end
Loading

Related Issues


Changes

Proto Definitions

File Change
proto/api/v1/user_service.proto Add auto_refresh_interval field
proto/api/v1/instance_service.proto Add enable_explore_auto_refresh, min_auto_refresh_interval
proto/store/user_setting.proto Add auto_refresh_interval field
proto/store/instance_setting.proto Add enable_explore_auto_refresh, min_auto_refresh_interval

Backend

File Change
server/router/api/v1/user_service.go Handler/converter for auto_refresh_interval
server/router/api/v1/instance_service.go Converter for new instance settings

Frontend

File Change
web/src/hooks/useAutoRefresh.ts New - Polling hook
web/src/components/PagedMemoList/PagedMemoList.tsx Integrate useAutoRefresh
web/src/components/Settings/PreferencesSection.tsx User setting UI
web/src/components/Settings/InstanceSection.tsx Admin setting UI
web/src/pages/Home.tsx, Explore.tsx Pass autoRefresh prop
web/src/locales/{en,ja}.json Add translation keys

Behavior

User Settings

  • Location: Settings > Preferences > Auto-refresh interval
  • Input: Seconds (0 = disabled, default = 10)
  • Constraint: Must be ≥ admin-configured minimum

Admin Settings

  • Enable Explore page auto-refresh: Toggle auto-refresh on Explore page (disabled by default to prevent excessive server load from public page polling)
  • Minimum auto-refresh interval: Floor for user-configured interval (default = 1s, also for server load control)

Polling Logic

  • Pauses when tab is hidden
  • Pauses when offline
  • Refreshes only when new memos are detected

FieldMask Naming Convention

New fields use snake_case for FieldMask paths.

// Correct
["auto_refresh_interval"]

// Incorrect - causes encoding error
["autoRefreshInterval"]

JSON Encoding of Field Masks
In JSON, a field mask is encoded as a single string where paths are separated by a comma. Fields name in each path are converted to/from lower-camel naming conventions.

Protocol Buffers Well-Known Types - Protocol Buffers Documentation

@boojack boojack requested a review from johnnyjoygh as a code owner January 7, 2026 15:10
@boojack boojack force-pushed the main branch 2 times, most recently from a196c72 to 71e8a06 Compare February 10, 2026 01:15
@boojack boojack force-pushed the main branch 2 times, most recently from 2b6b987 to 47d9414 Compare February 24, 2026 14:55
@milvasic
Copy link
Copy Markdown
Contributor

milvasic commented Feb 25, 2026

@boojack I think I created something similar in 5638

@boojack boojack closed this Feb 26, 2026
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.

3 participants