Skip to content

[Bug]: Wrong version in package.json #13727

@oddlama

Description

@oddlama

What happened?

For context, I'm packaging and building the AFFiNE backend server myself instead of using the docker container ghcr.io/toeverything/affine:stable in order to run it natively. Even though the build instructions seem a bit outdated I eventually got everything to work except that the server version reports an older version that what it actually is.

Looking at the source code I noticed that all package.json files, and importantly the packages/backend/server/package.json file, contain version: "0.22.4" instead of the actual version of the selected git tag. I'm not sure why this is the case, but unfortunately it causes the desktop client to refuse connections to the selfhosted server with the message:

Your server version 0.22.4 is not compatible with current client. Please upgrade your server to 0.23.0 or higher to use this client.

But technically the compiled version is actually whatever source code was tagged with the git tag v0.24.3. Now I'm wondering:

  1. Is there a reason as to why the version is not updated in this repository?
  2. How are you building the docker images then? Is there a hidden pre-configuration step that replaces the version?

Looking at a diff between git v0.24.3 and the docker container yields:

> diff -rq packages/backend/server /var/lib/containers/storage/overlay/437a72fce2762271b5a5da93b4b0b65c1633ab613f87a19f6d118efffb30404b/merged/app
Only in /var/lib/containers/storage/overlay/437a72fce2762271b5a5da93b4b0b65c1633ab613f87a19f6d118efffb30404b/merged/app: dist
Only in /var/lib/containers/storage/overlay/437a72fce2762271b5a5da93b4b0b65c1633ab613f87a19f6d118efffb30404b/merged/app: node_modules
Files packages/backend/server/package.json and /var/lib/containers/storage/overlay/437a72fce2762271b5a5da93b4b0b65c1633ab613f87a19f6d118efffb30404b/merged/app/package.json differ
Only in /var/lib/containers/storage/overlay/437a72fce2762271b5a5da93b4b0b65c1633ab613f87a19f6d118efffb30404b/merged/app: static

> diff packages/backend/server/package.json  /var/lib/containers/storage/overlay/437a72fce2762271b5a5da93b4b0b65c1633ab613f87a19f6d118efffb30404b/merged/app/package.json
4c4
<   "version": "0.22.4",
---
>   "version": "0.24.3",

Distribution version

Linux

App Version

v0.24.3

What browsers are you seeing the problem on if you're using web version?

No response

Are you self-hosting?

  • Yes

Self-hosting Version

v0.24.3 (allegedly)

Relevant log output

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🆕 *Untriaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions