Skip to content

Resolve connection callback schema TODO#1640

Closed
samuelscheit wants to merge 3 commits intospacebarchat:masterfrom
samuelscheit2:fix/1604-connection-callback-schema
Closed

Resolve connection callback schema TODO#1640
samuelscheit wants to merge 3 commits intospacebarchat:masterfrom
samuelscheit2:fix/1604-connection-callback-schema

Conversation

@samuelscheit
Copy link
Copy Markdown
Member

@samuelscheit samuelscheit commented May 6, 2026

Summary

  • type the connection callback openid_params payload as a string-valued OpenID parameter map
  • add callback schema coverage for required fields, optional flags, two_way_link_code, top-level extra-property rejection, and string-only OpenID params
  • preserve non-false additionalProperties in generated OpenAPI components so dictionary schemas remain typed

Root cause

ConnectionCallbackSchema.openid_params was unknown, so JSON schema validation and generated docs did not describe or enforce the OpenID callback parameter map. The OpenAPI generator also deleted every top-level additionalProperties, which erased map value types after schema generation.

Validation

  • npm run build
  • node -r dotenv/config -r module-alias/register --enable-source-maps --test dist/schemas/uncategorised/ConnectionCallbackSchema.test.js
  • npm run node:tests
  • npm run lint (passes with existing deprecation warnings in src/util/util/Token.ts)

Refs #1604

@samuelscheit samuelscheit marked this pull request as ready for review May 6, 2026 04:59
Copilot AI review requested due to automatic review settings May 6, 2026 04:59
@samuelscheit
Copy link
Copy Markdown
Member Author

Code review completed: I reviewed the final diff, generated schema/OpenAPI assets, and test coverage. No blocking issues found; the PR is approved from this review pass.

@samuelscheit
Copy link
Copy Markdown
Member Author

PR handling report (pass 1):

Changed files:

  • src/schemas/uncategorised/ConnectionCallbackSchema.ts
  • src/schemas/uncategorised/ConnectionCallbackSchema.test.ts
  • scripts/openapi.js
  • assets/schemas.json
  • assets/openapi.json

Tests/checks run:

  • npm run build — passed
  • node -r dotenv/config -r module-alias/register --enable-source-maps --test dist/schemas/uncategorised/ConnectionCallbackSchema.test.js — passed (3 tests)
  • npm run node:tests — passed (56 tests, 0 failures)
  • npm run lint — passed with 2 existing deprecation warnings in src/util/util/Token.ts
  • npx prettier --check . — failed on .lintstagedrc.mjs, eslint.config.mjs, and src/cdn/util/Storage.ts

Code-review outcome:

  • Reviewed the final diff and generated schema/OpenAPI assets.
  • No blocking code issues found in the schema/OpenAPI changes.
  • PR was marked ready for review.

Decision:

  • Needs another pass before final approval because the GitHub Style / build (24.x) check is failing on repository-wide Prettier formatting.

@samuelscheit
Copy link
Copy Markdown
Member Author

samuelscheit commented May 6, 2026

Second-pass code review completed after the CI formatting fix. The added .lintstagedrc.mjs, eslint.config.mjs, and src/cdn/util/Storage.ts changes are formatting-only, and the schema/OpenAPI diff remains scoped to ConnectionCallbackSchema / ConnectionCallbackOpenIdParams. No blocking issues found; approved from this review pass pending remaining check completion.

@samuelscheit
Copy link
Copy Markdown
Member Author

Final PR handling report:

Changed files:

  • src/schemas/uncategorised/ConnectionCallbackSchema.ts
  • src/schemas/uncategorised/ConnectionCallbackSchema.test.ts
  • scripts/openapi.js
  • assets/schemas.json
  • assets/openapi.json
  • .lintstagedrc.mjs (format-only for CI)
  • eslint.config.mjs (format-only for CI)
  • src/cdn/util/Storage.ts (format-only for CI)

Tests/checks run:

  • npm run build — passed
  • node -r dotenv/config -r module-alias/register --enable-source-maps --test dist/schemas/uncategorised/ConnectionCallbackSchema.test.js — passed (3 tests)
  • npm run node:tests — passed (56 tests, 0 failures)
  • npm run lint — passed with 2 existing deprecation warnings in src/util/util/Token.ts
  • npx prettier --check . — passed after the formatting pass
  • GitHub checks on latest head d24f859: Style / build (24.x) passed; Nix build / build-nix passed

Code-review outcome:

  • Reviewed the final source/config diff and verified generated asset changes are limited to ConnectionCallbackSchema and ConnectionCallbackOpenIdParams.
  • No blocking issues found.
  • PR is marked ready for review.

Decision:

  • Approved; no another pass needed.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

2 participants