[GH-ISSUE #1140] In print -j hasArchive always false #470

Open
opened 2026-02-25 23:34:17 +03:00 by kerem · 1 comment
Owner

Originally created by @mrkingmidas on GitHub (Sep 4, 2025).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/1140

Data

  • Shiori version: 1.8.0-rc.1
  • Database Engine: SQLite
  • Operating system: Windows 10 1909
  • CLI/Web interface/Web Extension: CLI, portable

Describe the bug / actual behavior

Run print -j and in all bookmarks hasArchive set to false, but in WEB UI archive exists

Expected behavior

hasArchive have correct value

To Reproduce

Steps to reproduce the behavior:

  1. Create bookmark with archive
  2. Run shiori.exe print -j
  3. In output hasArchive set to false

Screenshots

If applicable, add screenshots to help explain your problem.

Notes

Add any other context about the problem here.

Originally created by @mrkingmidas on GitHub (Sep 4, 2025). Original GitHub issue: https://github.com/go-shiori/shiori/issues/1140 ## Data - **Shiori version**: 1.8.0-rc.1 - **Database Engine**: SQLite - **Operating system**: Windows 10 1909 - **CLI/Web interface/Web Extension**: CLI, portable ## Describe the bug / actual behavior Run `print -j` and in all bookmarks `hasArchive` set to `false`, but in WEB UI archive exists ## Expected behavior `hasArchive` have correct value ## To Reproduce Steps to reproduce the behavior: 1. Create bookmark with `archive` 2. Run `shiori.exe print -j` 3. In output `hasArchive` set to `false` ## Screenshots If applicable, add screenshots to help explain your problem. ## Notes Add any other context about the problem here.
Author
Owner

@mirkoperillo commented on GitHub (Sep 23, 2025):

Looking at the codebase I think I can confirm this is a bug.

The WEB UI calls this API of the server /api/bookmarks?keyword=&tags=&exclude=&page=1. What does the related handler ?

  1. Loads bookmark data from db
    github.com/go-shiori/shiori@ca949c5dab/internal/webserver/handler-api.go (L91)
  2. Then enriches the returned data and in particular the field hasArchive
    github.com/go-shiori/shiori@ca949c5dab/internal/webserver/handler-api.go (L106)

What the command shiori print -j does is different; it only retrieves data from db but never enriches it with hasArchive data.
github.com/go-shiori/shiori@ca949c5dab/internal/cmd/print.go (L66)

The hasArchive data should be enriched after the database read because is not something saved in it.
The bookmark table:

CREATE TABLE IF NOT EXISTS bookmark(
    id INTEGER NOT NULL,
    url TEXT NOT NULL,
    title TEXT NOT NULL,
    excerpt TEXT NOT NULL DEFAULT "",
    author TEXT NOT NULL DEFAULT "",
    public INTEGER NOT NULL DEFAULT 0,
    modified TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
    has_content BOOLEAN DEFAULT FALSE NOT NULL,
    CONSTRAINT bookmark_PK PRIMARY KEY(id),
    CONSTRAINT bookmark_url_UNIQUE UNIQUE(url)
);
<!-- gh-comment-id:3324194173 --> @mirkoperillo commented on GitHub (Sep 23, 2025): Looking at the codebase I think I can confirm this is a bug. The WEB UI calls this API of the server `/api/bookmarks?keyword=&tags=&exclude=&page=1`. What does the related handler ? 1. Loads bookmark data from db https://github.com/go-shiori/shiori/blob/ca949c5dabbd23e1e3a11ce9afae2dd766eb0f60/internal/webserver/handler-api.go#L91 2. Then enriches the returned data and in particular the field `hasArchive` https://github.com/go-shiori/shiori/blob/ca949c5dabbd23e1e3a11ce9afae2dd766eb0f60/internal/webserver/handler-api.go#L106 What the command `shiori print -j` does is different; it only retrieves data from db but never enriches it with `hasArchive` data. https://github.com/go-shiori/shiori/blob/ca949c5dabbd23e1e3a11ce9afae2dd766eb0f60/internal/cmd/print.go#L66 The `hasArchive` data should be enriched after the database read because is not something saved in it. The bookmark table: ``` CREATE TABLE IF NOT EXISTS bookmark( id INTEGER NOT NULL, url TEXT NOT NULL, title TEXT NOT NULL, excerpt TEXT NOT NULL DEFAULT "", author TEXT NOT NULL DEFAULT "", public INTEGER NOT NULL DEFAULT 0, modified TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, has_content BOOLEAN DEFAULT FALSE NOT NULL, CONSTRAINT bookmark_PK PRIMARY KEY(id), CONSTRAINT bookmark_url_UNIQUE UNIQUE(url) ); ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#470
No description provided.