Skip to content

Google Reader API edit-tag marks articles read one per transaction on PostgreSQL and SQLite #9574

Closed

Description

@quinnypig

Describe the bug

On PostgreSQL (and SQLite), marking a list of articles read through the Google Reader API (edit-tag) runs one transaction per article. FreshRSS_EntryDAOSQLite::markRead() loops over the IDs (//TODO: Not implemented yet for SQLite (so always call IDs one by one)), and FreshRSS_EntryDAOPGSQL inherits that loop.

With a database across a network, each ID costs several round trips (BEGIN, UPDATE, sometimes a feed counter UPDATE, COMMIT). Against a managed PostgreSQL about 100 ms away per query, an edit-tag with a few hundred IDs took 50–120 s. Reeder on iOS gave up after about 30 s and resent the same batch on every sync, so it never fetched new articles. The server did finish each request eventually, so read states were saved, but the client never saw a success.

To Reproduce

  1. Use PostgreSQL with some network latency (e.g. tc qdisc add dev eth0 root netem delay 25ms on the database host).
  2. Through the Google Reader API, mark ~300 unread articles read in a single edit-tag request (a=user/-/state/com.google/read with many i= values).
  3. The request takes about a minute (60.5 s in my test at ~75 ms round trip).

Expected behavior

One batched UPDATE … WHERE is_read<>? AND id IN (…), as the MySQL/MariaDB DAO already does in FreshRSS_EntryDAO::markRead().

FreshRSS version

1.30.4 (code unchanged on edge)

System info

PostgreSQL 17 (managed), PHP 8.4, official Docker image. Also reproduced on SQLite (local file: 300 IDs in 1.48 s vs 0.01 s batched).

Activity

  1. added this to the 1.31.0 milestone on Nov 17, 2026
  2. added
    API 🤝
    on Nov 17, 2026
  3. Alkarex commented on Nov 17, 2026

    @Alkarex
    Member

    Thanks for the PR! And you are welcome to directly submit a PR without first filing an issue

  4. added a commit that references this issue on Nov 17, 2026
    d6c907b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    API 🤝

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions