Problem
On a published document, cancelling a like reports success and reduces the displayed count optimistically, but does not persist the decrement. Reloading restores the higher count.
Reproduction
Use a disposable local database and a synthetic published document:
- Record the initial count N.
- Like the document and wait for the increase request to succeed; the count is N + 1.
- Click again to cancel and wait for the decrease request to succeed; the interface shows N.
- Reload the page: the count is N + 1.
This was observed during local appearance acceptance, with all writes confined to an isolated test environment.
Source evidence
src/app/api/pub/thumb-up-decrease/[publishId]/route.ts:6 returns success unconditionally; the database decrement beginning at line 15 is commented out.
src/components/thumb-up-button.tsx:28 reduces the displayed count optimistically and calls the decrease endpoint at line 31.
These API lines already exist on main at 0d88ec4b94f6fdb669fad1db858058650eb8c76e. The appearance change tracked in #57 does not modify this endpoint.
Expected result
A successful cancellation should be reflected after reload, with an appropriate nonnegative count and consistent error handling. A future fix should include a persisted readback regression and explicitly define any identity or duplicate-cancellation behavior. No API change is included in the appearance PR.
Problem
On a published document, cancelling a like reports success and reduces the displayed count optimistically, but does not persist the decrement. Reloading restores the higher count.
Reproduction
Use a disposable local database and a synthetic published document:
This was observed during local appearance acceptance, with all writes confined to an isolated test environment.
Source evidence
src/app/api/pub/thumb-up-decrease/[publishId]/route.ts:6returns success unconditionally; the database decrement beginning at line 15 is commented out.src/components/thumb-up-button.tsx:28reduces the displayed count optimistically and calls the decrease endpoint at line 31.These API lines already exist on main at
0d88ec4b94f6fdb669fad1db858058650eb8c76e. The appearance change tracked in #57 does not modify this endpoint.Expected result
A successful cancellation should be reflected after reload, with an appropriate nonnegative count and consistent error handling. A future fix should include a persisted readback regression and explicitly define any identity or duplicate-cancellation behavior. No API change is included in the appearance PR.