Skip to content

fix(desktop): decode Desktop 2.3 numeric connection createdAt (CLI-242) - #267

Open
oskarhane wants to merge 2 commits into
oskar/cli-239-desktop-projects-tagsfrom
oskar/cli-242-desktop-createdat-fix
Open

oskarhane wants to merge 2 commits into
oskar/cli-239-desktop-projects-tagsfrom
oskar/cli-242-desktop-createdat-fix

Conversation

@oskarhane

@oskarhane oskarhane commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fix (CLI-242): desktop list and desktop connection list failed against Neo4j Desktop 2.3, which sends connection createdAt as an integer unix-ms timestamp (neo4j-desktop-2 PR #355) while the CLI modeled it as a string — breaking JSON decode of the whole list. Stacked on #256.

Changes

  • Connection.CreatedAt is now an optional int64 (json:"createdAt,omitempty") on the wire struct, matching how Project.CreatedAt is already modeled
  • ConnectionOutput.created_at renders RFC3339 UTC and is omitted when absent; Connection.ToOutput is now an explicit field-by-field projection (no longer a straight struct conversion)
  • Both list commands decode Desktop 2.3-shaped (numeric) and pre-2.3/absent createdAt payloads
  • Regression tests at every layer: client decode (numeric/absent), output projection (rendered/omitted), command-level JSON goldens
  • Single shared formatter: desktopclient.FormatUnixMsRFC3339 is the one unix-ms → RFC3339 implementation; the project command's private duplicate was deleted and both its call sites rewired

User-facing impact

neo4j-cli desktop list and neo4j-cli desktop connection list work again against Desktop 2.3 instead of failing with a JSON decode error. Connection created_at now appears in JSON/TOON/table output as an RFC3339 UTC timestamp (omitted when Desktop doesn't send one).

Example usage

$ neo4j-cli desktop connection list --format json
{
  "connections": [
    {
      "id": "…",
      "name": "…",
      "connection_uri": "neo4j://localhost:7687",
      "created_at": "2026-04-17T10:00:00Z"
    }
  ]
}

This description was auto generated

@claude

claude Bot commented Oct 14, 2026

Copy link
Copy Markdown

Security review (golang-security skill, review mode)

The skill reviewed the changed Go files. The PR changes Connection.CreatedAt from string to int64 (unix-ms) and adds a shared FormatUnixMsRFC3339 formatter. It handles no new untrusted input beyond a typed numeric JSON decode, and it adds no injection, filesystem, network, crypto, secrets or logging surface. Decoding is strict, so a malformed value returns an error rather than being used. Negative and zero values render as an empty string and are omitted from output.

No issues found.

Security review: ✅ no issues found

@oskarhane
oskarhane added this pull request to stack #268 October 14, 2026 10:21
@claude

claude Bot commented Oct 14, 2026

Copy link
Copy Markdown

Conventions review (AGENTS.md gates)

Reviewed the Desktop 2.3 createdAt decode fix. It changes no cobra command strings, flags or commands, so no skill-bundle regeneration is needed. The new output_test.go has the license header, and the user-facing fix has a Patch changelog entry.

No issues found.

Conventions review: ✅ no issues found

…optional int64 unix-ms and render created_at as RFC3339 UTC
…to RFC3339 formatter as desktopclient.FormatUnixMsRFC3339
@oskarhane
oskarhane force-pushed the oskar/cli-242-desktop-createdat-fix branch from 036ff41 to a22c481 Compare October 15, 2026 07:43
@claude

claude Bot commented Oct 15, 2026

Copy link
Copy Markdown

Security review (golang-security skill, review mode)

Analysed the PR's Go changes: Connection.CreatedAt changes from string to int64 unix-ms, a new FormatUnixMsRFC3339 helper, and project output refactored to use it. The data comes from the local Neo4j Desktop API and only goes through encoding/json decoding and time.UnixMilli(...).Format. There is no injection, path, crypto, secrets or auth surface, and non-positive values are rendered as empty. Overall posture is clean.

No issues found.

Security review: ✅ no issues found

@oplane-bot

oplane-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

Oplane Security Review

Oplane identified security requirements relevant to this PR and checked the implementation against them. All requirements are satisfied. Review the generated threat model.

StatusRequirementSeverityAction
🟢 ImplementedInput Validation for Numeric Timestamp Field in Desktop API Response
OPLANE_REQ-00299570
Low

Change comment settings · Set up Oplane in your agent · Workflow guidance

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant