Skip to content

Preventing Server Crash on Compromised Lock #535

@haldunbayrak

Description

@haldunbayrak

What happened?

Server Crash

We patched createLockOptions in cli.js to define a default warning-only onCompromised callback when none is provided:

` function createLockOptions(request2, lockfilePath) {
const options = {
stale: request2.staleMs ?? DEFAULT_LOCK_STALE_MS,
retries: request2.retries ?? DEFAULT_LOCK_RETRIES,
realpath: false,
lockfilePath
};

  • if (typeof request2.onCompromised === "function") {
  • options.onCompromised = request2.onCompromised;
  • }
  • options.onCompromised = (err) => {
  • if (typeof request2.onCompromised === "function") {
  •  request2.onCompromised(err);
    
  • } else {
  •  console.warn("Lock compromised:", err.message);
    
  • }
  • };
    return options;
    }
    `
    This safely intercepts file lock deletion events, printing a warning rather than crashing the node process.

Steps to reproduce

N/a

Expected behavior

No response

Kanban version

0.1.68

Environment

MacOS, Node v22.18.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions