Skip to content

WHFSFile.republish() does nothing for a published file that is not queued #16

Description

@wouterhendriks

We wanted to republish a statically published site from a TypeScript scheduled task. Since @webhare/whfs has no folder republish, we called republish() on every file from site.listRecursive(), inside whdb.runInWork().

Expected: the files get queued and republished. What happened: nothing. system.fs_objects.published stayed at 900000 for a published file (id 66194) before, during and after the work, and lastpublishdate did not change. No error. Calling ScheduleFolderRepublish from mod::publisher/lib/control.whlib via loadlib in the same kind of script did republish all files within seconds.

Measured on a local install built from master 43ed756 (2026-09-24).

What stands out, from reading the code: convertToWillPublish in jssdk/whfs/src/support.ts (line 103) passes curPrioOrError (published % 100000, which is 0 for a published file that is not queued) to isPublish(), so the "once published" flag is never seen and the function returns early. The HareScript ConvertToWillPublish in system/lib/internal/whfs/support.whlib (line 91) checks the once-published flag on the full value. The same call with enablePublishIfDisabled = false also appears in objects.ts (line 362) and finishhandler.ts (line 55); we did not measure those paths.

Separately: is a folder/site republish from TypeScript planned, or is loadlib + ScheduleFolderRepublish the intended route for now?

Happy to put together a minimal module that reproduces this, if that helps.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions