Repository navigation
fix: enable typecheck in client-web build and fix all type errors - #2934
Conversation
📝 WalkthroughWalkthroughSwitches toast composable to Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (8)
apps/client-web/pages/clients/[id].vue (1)
65-69:⚠️ Potential issue | 🟡 MinorBug: Incorrect toast variant for error handling.
The
handleFailedfunction usesvariant: 'success'when displaying error messages. This should bevariant: 'warning'to match the pattern in other entity pages (permissions, roles, realms, robots).🐛 Proposed fix
const handleFailed = (e: Error) => { if (toast) { - toast.show({ variant: 'success', body: e.message }); + toast.show({ variant: 'warning', body: e.message }); } };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/client-web/pages/clients/`[id].vue around lines 65 - 69, The handleFailed error handler displays errors with the wrong toast variant; locate the handleFailed function and change the toast.show call to use variant: 'warning' instead of 'success' so error toasts match other entity pages (permissions, roles, realms, robots) and correctly signal a problem.apps/client-web/pages/robots/[id].vue (1)
49-52:⚠️ Potential issue | 🟠 MajorBug: Missing
throwbeforecreateError({}).Unlike other entity pages (roles, permissions, realms, clients) that use
throw createError({}), this page only callscreateError({})without throwing it. This means execution continues after navigation, potentially causing errors when the template accessesentity.nameorentity.idon an uninitialized ref.🐛 Proposed fix
} catch { await navigateTo({ path: '/robots' }); - createError({}); + throw createError({}); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/client-web/pages/robots/`[id].vue around lines 49 - 52, In the catch block of the page component (the try/catch around the robot fetch that calls navigateTo and createError), change the call to createError({}) to be thrown so execution stops (i.e., use throw createError({})); this is the same pattern used in other entity pages — locate the catch that calls navigateTo({ path: '/robots' }) and replace createError({}) with throw createError({}) to prevent the template from rendering with an uninitialized entity ref.apps/client-web/pages/roles/index/index.vue (1)
118-120:⚠️ Potential issue | 🟡 MinorBug:
updated_atcolumn displayscreated_atvalue.Same issue as other index pages.
Proposed fix
<template `#cell`(updated_at)="data"> - <VCTimeago :datetime="data.item.created_at" /> + <VCTimeago :datetime="data.item.updated_at" /> </template>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/client-web/pages/roles/index/index.vue` around lines 118 - 120, The updated_at column is rendering the created_at value; in the template with the slot "#cell(updated_at)" replace the incorrect property access data.item.created_at with data.item.updated_at so VCTimeago receives the updated_at timestamp (locate the template that uses VCTimeago inside the "#cell(updated_at)" slot and update the bound prop).apps/client-web/pages/clients/index/index.vue (1)
127-129:⚠️ Potential issue | 🟡 MinorBug:
updated_atcolumn displayscreated_atvalue.Same issue as other index pages.
Proposed fix
<template `#cell`(updated_at)="data"> - <VCTimeago :datetime="data.item.created_at" /> + <VCTimeago :datetime="data.item.updated_at" /> </template>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/client-web/pages/clients/index/index.vue` around lines 127 - 129, The updated_at column is rendering the wrong field: in the template with slot `#cell`(updated_at)="data" it passes data.item.created_at to <VCTimeago>; change that to use data.item.updated_at (i.e., update the VCTimeago :datetime binding in the updated_at cell template from created_at to updated_at) so the column shows the correct timestamp (same fix applied as other index pages).apps/client-web/pages/users/index/index.vue (1)
97-99:⚠️ Potential issue | 🟡 MinorBug:
updated_atcolumn displayscreated_atvalue.Same issue as other index pages.
Proposed fix
<template `#cell`(updated_at)="data"> - <VCTimeago :datetime="data.item.created_at" /> + <VCTimeago :datetime="data.item.updated_at" /> </template>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/client-web/pages/users/index/index.vue` around lines 97 - 99, The updated_at column template is incorrectly rendering data.item.created_at; update the template slot for `#cell`(updated_at) to pass data.item.updated_at to VCTimeago (i.e., change the prop on VCTimeago in the `#cell`(updated_at) template so it uses data.item.updated_at instead of created_at) so the displayed time reflects the updated_at value.apps/client-web/pages/robots/index/index.vue (1)
93-95:⚠️ Potential issue | 🟡 MinorBug:
updated_atcolumn displayscreated_atvalue.Same issue as other index pages - the
updated_atslot incorrectly referencesdata.item.created_at.Proposed fix
<template `#cell`(updated_at)="data"> - <VCTimeago :datetime="data.item.created_at" /> + <VCTimeago :datetime="data.item.updated_at" /> </template>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/client-web/pages/robots/index/index.vue` around lines 93 - 95, The updated_at column slot incorrectly renders the created_at timestamp; in the template slot named "cell(updated_at)" (where VCTimeago is used) change the bound prop from data.item.created_at to data.item.updated_at so VCTimeago displays the record's updated_at value.apps/client-web/pages/permissions/index/index.vue (1)
118-120:⚠️ Potential issue | 🟡 MinorBug:
updated_atcolumn displayscreated_atvalue.Same issue as other index pages.
Proposed fix
<template `#cell`(updated_at)="data"> - <VCTimeago :datetime="data.item.created_at" /> + <VCTimeago :datetime="data.item.updated_at" /> </template>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/client-web/pages/permissions/index/index.vue` around lines 118 - 120, The updated_at column template is rendering the wrong field (it uses data.item.created_at); update the template for the slot named "cell(updated_at)" so VCTimeago receives data.item.updated_at instead, i.e., locate the <template `#cell`(updated_at)> block and change the prop passed to VCTimeago from created_at to updated_at to correctly display the updated timestamp.apps/client-web/pages/realms/index/index.vue (1)
90-92:⚠️ Potential issue | 🟡 MinorBug:
updated_atcolumn displayscreated_atvalue.The template slot for
updated_atincorrectly usesdata.item.created_at. This appears to be a pre-existing bug, but worth fixing while you're in this file.Proposed fix
<template `#cell`(updated_at)="data"> - <VCTimeago :datetime="data.item.created_at" /> + <VCTimeago :datetime="data.item.updated_at" /> </template>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/client-web/pages/realms/index/index.vue` around lines 90 - 92, The updated_at column slot currently renders the wrong field; in the template slot identified by `#cell`(updated_at)="data" replace the VCTimeago binding from data.item.created_at to data.item.updated_at so the VCTimeago component displays the record's updated_at timestamp instead of created_at.
🧹 Nitpick comments (2)
packages/core-http-kit/src/hook/module.ts (1)
73-75: Usefor...ofiteration instead of non-null assertions in these loops.Lines 74 and 84 use
!to suppress nullability from index-based array access (enabled bystrict: truein tsconfig). Switching tofor...ofavoids the assertions and is more idiomatic.♻️ Suggested refactor
- for (let i = 0; i < this.clients.length; i++) { - this.clients[i]!.setAuthorizationHeader(value); - } + for (const client of this.clients) { + client.setAuthorizationHeader(value); + } - for (let i = 0; i < this.clients.length; i++) { - this.clients[i]!.unsetAuthorizationHeader(); - } + for (const client of this.clients) { + client.unsetAuthorizationHeader(); + }Also applies to: 83-85
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core-http-kit/src/hook/module.ts` around lines 73 - 75, Replace the index-based loops over this.clients that use non-null assertions with idiomatic for...of iteration: iterate using "for (const client of this.clients) { if (!client) continue; client.setAuthorizationHeader(value); }" (and the same pattern for the other loop at lines 83-85), removing the "!" operator; locate the loops that call setAuthorizationHeader on entries of this.clients and update them to null-check each iterated client before invoking the method.apps/client-web/composables/toast.ts (1)
30-39: Avoid mutating caller-provided toast option objects.Line 31 and Line 38 mutate input params (
el/options), which can create side effects if objects are reused by callers. Build derived props objects instead.Proposed immutable defaulting
if (isObject(el)) { - el.position = el.position || 'top-center'; + const props = { + ...el, + position: el.position ?? 'top-center', + }; return toast.show({ - props: el, + props, }); } -if (options) { - options.position = options.position || 'top-center'; -} +const props = { + ...(options || {}), + position: options?.position ?? 'top-center', + body: el, +}; return toast.show({ - props: { - ...(options || {}), - body: el, - }, + props, });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/client-web/composables/toast.ts` around lines 30 - 39, The code currently mutates caller-provided option objects (`el` and `options`) before calling `toast.show`, which can cause side effects; instead create shallow copies and set defaults on the copies (e.g., build a new props/options object via spread: {...el, position: el.position || 'top-center'} and {...options, position: options.position || 'top-center'}) and pass those to `toast.show` so the original `el`/`options` objects are not modified.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/client-web/composables/toast.ts`:
- Around line 16-20: The current show() and hide() implementations access
internal bootstrap-vue-next internals (toast.store.value, _self,
promise.resolve); change show() to call the documented toast.create(...) API and
capture the returned toast id/handle (store that id on the created toast object
or in your local state), and change hide(el: symbol) to call the documented
toast.remove(id) or toast.destroy(id) using that stored id instead of iterating
toast.store or touching promise.resolve; update any other code that expects the
old promise/_self behavior to use the public handle/id returned by
toast.create().
In `@apps/client-web/plugins/bootstrap.ts`:
- Around line 15-17: The createBootstrap call in bootstrap.ts is passing an
invalid option (orchestrator: true) — remove the orchestrator (and any other
invalid options like toast/popover) from the createBootstrap(...) configuration
used in ctx.vueApp.use(createBootstrap(...)); then enable orchestrator via one
of the supported approaches: add the <BOrchestrator /> component into your root
App.vue template, or replace your root with the BApp component (recommended)
which has orchestrator built-in, or import/use the orchestratorPlugin
separately; keep the invocation of createBootstrap without unsupported options
and adjust App.vue to include BOrchestrator or switch to BApp accordingly.
In
`@packages/client-web-kit/src/components/entities/identity-provider/AIdentityProviderIcon.ts`:
- Around line 26-33: The code passes a possibly-null props.entity.protocol into
AIdentityProviderProtocol (which expects a required string id) without guarding;
update the render in AIdentityProviderIcon so you check props.entity.protocol
!== null/undefined before creating h(AIdentityProviderProtocol, { id:
props.entity.protocol as string }) and render an appropriate fallback (e.g.,
nothing or a placeholder) when protocol is null, and remove the unnecessary cast
on props.entity.preset since the earlier guard already narrows its type; ensure
you reference AIdentityProviderProtocol and props.entity.protocol in the fix.
In `@packages/client-web-kit/src/components/entities/user/AUserPasswordForm.ts`:
- Around line 29-32: The component AUserPasswordForm currently force-asserts
props.id (props.id!) before calling update, which can send an invalid request
when id is missing; update the submit handler in AUserPasswordForm to
runtime-guard props.id (e.g., if (!props.id) { return / handle error }) and only
call the update function when id is present, passing a narrowed string (cast or
inferred after the guard) instead of using the non-null assertion; locate
occurrences of props.id! (the submit/update code path) and replace them with
this explicit guard and conditional update call.
In `@packages/client-web-kit/src/components/utility/entity/record/module.ts`:
- Around line 298-299: Remove the redundant cast on rctx.query (it's already
BuildInput<RECORD>) and stop using `as any` when adding filters/fields; instead
construct a new typed BuildInput<RECORD> object immutably (e.g., const query:
BuildInput<RECORD> = { ...rctx.query, filters: newFilters, fields: newFields })
so the additions to `filters` and `fields` preserve types; update the code in
this module to use that new `query` value wherever `query` was mutated
(referencing rctx.query, the local query variable, and the `filters`/`fields`
properties) to satisfy strict typechecks without runtime casts.
In `@packages/client-web-kit/src/core/socket-manager/install.ts`:
- Around line 36-37: Normalize the access token before comparing to avoid
null/undefined mismatches: compute a normalized value from state.accessToken
(e.g., newToken = state.accessToken ?? undefined), then compare newToken against
oldValue.value and only assign oldValue.value = newToken and trigger reconnect
when they differ; update the logic around the existing state.accessToken and
oldValue.value checks in install.ts to use this normalized token for both
comparison and assignment.
In `@packages/kit/src/template.ts`:
- Around line 19-20: The placeholder replacement currently uses typeof data[key]
!== 'undefined' which also matches inherited prototype properties; change this
to an own-property check such as Object.prototype.hasOwnProperty.call(data, key)
(or data != null && Object.hasOwn(data, key) if available) before substituting
match[0] with data[key] in the same code path (the block that currently returns
acc.replace(match[0], data[key])). Ensure you reference the same key and match
variables and preserve existing behavior for genuine own properties.
---
Outside diff comments:
In `@apps/client-web/pages/clients/`[id].vue:
- Around line 65-69: The handleFailed error handler displays errors with the
wrong toast variant; locate the handleFailed function and change the toast.show
call to use variant: 'warning' instead of 'success' so error toasts match other
entity pages (permissions, roles, realms, robots) and correctly signal a
problem.
In `@apps/client-web/pages/clients/index/index.vue`:
- Around line 127-129: The updated_at column is rendering the wrong field: in
the template with slot `#cell`(updated_at)="data" it passes data.item.created_at
to <VCTimeago>; change that to use data.item.updated_at (i.e., update the
VCTimeago :datetime binding in the updated_at cell template from created_at to
updated_at) so the column shows the correct timestamp (same fix applied as other
index pages).
In `@apps/client-web/pages/permissions/index/index.vue`:
- Around line 118-120: The updated_at column template is rendering the wrong
field (it uses data.item.created_at); update the template for the slot named
"cell(updated_at)" so VCTimeago receives data.item.updated_at instead, i.e.,
locate the <template `#cell`(updated_at)> block and change the prop passed to
VCTimeago from created_at to updated_at to correctly display the updated
timestamp.
In `@apps/client-web/pages/realms/index/index.vue`:
- Around line 90-92: The updated_at column slot currently renders the wrong
field; in the template slot identified by `#cell`(updated_at)="data" replace the
VCTimeago binding from data.item.created_at to data.item.updated_at so the
VCTimeago component displays the record's updated_at timestamp instead of
created_at.
In `@apps/client-web/pages/robots/`[id].vue:
- Around line 49-52: In the catch block of the page component (the try/catch
around the robot fetch that calls navigateTo and createError), change the call
to createError({}) to be thrown so execution stops (i.e., use throw
createError({})); this is the same pattern used in other entity pages — locate
the catch that calls navigateTo({ path: '/robots' }) and replace createError({})
with throw createError({}) to prevent the template from rendering with an
uninitialized entity ref.
In `@apps/client-web/pages/robots/index/index.vue`:
- Around line 93-95: The updated_at column slot incorrectly renders the
created_at timestamp; in the template slot named "cell(updated_at)" (where
VCTimeago is used) change the bound prop from data.item.created_at to
data.item.updated_at so VCTimeago displays the record's updated_at value.
In `@apps/client-web/pages/roles/index/index.vue`:
- Around line 118-120: The updated_at column is rendering the created_at value;
in the template with the slot "#cell(updated_at)" replace the incorrect property
access data.item.created_at with data.item.updated_at so VCTimeago receives the
updated_at timestamp (locate the template that uses VCTimeago inside the
"#cell(updated_at)" slot and update the bound prop).
In `@apps/client-web/pages/users/index/index.vue`:
- Around line 97-99: The updated_at column template is incorrectly rendering
data.item.created_at; update the template slot for `#cell`(updated_at) to pass
data.item.updated_at to VCTimeago (i.e., change the prop on VCTimeago in the
`#cell`(updated_at) template so it uses data.item.updated_at instead of
created_at) so the displayed time reflects the updated_at value.
---
Nitpick comments:
In `@apps/client-web/composables/toast.ts`:
- Around line 30-39: The code currently mutates caller-provided option objects
(`el` and `options`) before calling `toast.show`, which can cause side effects;
instead create shallow copies and set defaults on the copies (e.g., build a new
props/options object via spread: {...el, position: el.position || 'top-center'}
and {...options, position: options.position || 'top-center'}) and pass those to
`toast.show` so the original `el`/`options` objects are not modified.
In `@packages/core-http-kit/src/hook/module.ts`:
- Around line 73-75: Replace the index-based loops over this.clients that use
non-null assertions with idiomatic for...of iteration: iterate using "for (const
client of this.clients) { if (!client) continue;
client.setAuthorizationHeader(value); }" (and the same pattern for the other
loop at lines 83-85), removing the "!" operator; locate the loops that call
setAuthorizationHeader on entries of this.clients and update them to null-check
each iterated client before invoking the method.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c8ddcc3e-0956-4397-9eec-11994db902a4
📒 Files selected for processing (63)
apps/client-web/composables/toast.tsapps/client-web/package.jsonapps/client-web/pages/clients/[id].vueapps/client-web/pages/clients/index/index.vueapps/client-web/pages/identity-providers/[id].vueapps/client-web/pages/identity-providers/index/index.vueapps/client-web/pages/permissions/[id].vueapps/client-web/pages/permissions/index/index.vueapps/client-web/pages/policies/[id].vueapps/client-web/pages/policies/index/index.vueapps/client-web/pages/realms/[id].vueapps/client-web/pages/realms/index/index.vueapps/client-web/pages/robots/[id].vueapps/client-web/pages/robots/index/index.vueapps/client-web/pages/roles/[id].vueapps/client-web/pages/roles/index/index.vueapps/client-web/pages/scopes/[id].vueapps/client-web/pages/scopes/index/index.vueapps/client-web/pages/settings/index/index.vueapps/client-web/pages/settings/index/security.vueapps/client-web/pages/users/[id].vueapps/client-web/pages/users/index/index.vueapps/client-web/plugins/bootstrap.tsapps/client-web/tsconfig.jsonpackages/client-web-kit/src/components/entities/client/AClientForm.vuepackages/client-web-kit/src/components/entities/identity-provider/AIdentityProviderForm.tspackages/client-web-kit/src/components/entities/identity-provider/AIdentityProviderIcon.tspackages/client-web-kit/src/components/entities/identity-provider/AIdentityProviderOAuth2Form.tspackages/client-web-kit/src/components/entities/permission/APermissionForm.tspackages/client-web-kit/src/components/entities/policy/APolicyBasicForm.vuepackages/client-web-kit/src/components/entities/policy/attribute-names/AAttributeNamesPolicyForm.vuepackages/client-web-kit/src/components/entities/policy/realm-match/ARealmMatchPolicyForm.vuepackages/client-web-kit/src/components/entities/role/ARoleForm.tspackages/client-web-kit/src/components/entities/scope/AScopeForm.tspackages/client-web-kit/src/components/entities/user/AUserForm.tspackages/client-web-kit/src/components/entities/user/AUserPasswordForm.tspackages/client-web-kit/src/components/utility/entity/collection/utils/handlers.tspackages/client-web-kit/src/components/utility/entity/record/module.tspackages/client-web-kit/src/components/utility/entity/record/types.tspackages/client-web-kit/src/components/utility/form-input-list/AFormInputList.vuepackages/client-web-kit/src/components/utility/pagination/APagination.tspackages/client-web-kit/src/components/utility/pagination/module.tspackages/client-web-kit/src/components/utility/pagination/type.tspackages/client-web-kit/src/components/utility/search/ASearch.tspackages/client-web-kit/src/components/workflows/Login.vuepackages/client-web-kit/src/components/workflows/authorize/AuthorizeScopes.vuepackages/client-web-kit/src/composables/updated-at.tspackages/client-web-kit/src/core/socket-manager/install.tspackages/core-http-kit/src/hook/module.tspackages/core-kit/src/domains/client/validator.tspackages/core-kit/src/domains/identity-provider/attributes-validator.tspackages/core-kit/src/domains/identity-provider/ldap/validator.tspackages/core-kit/src/domains/identity-provider/oauth2/preset-validator.tspackages/core-kit/src/domains/identity-provider/oauth2/validator.tspackages/core-kit/src/domains/identity-provider/validator.tspackages/core-kit/src/domains/permission/validator.tspackages/core-kit/src/domains/policy/validator.tspackages/core-kit/src/domains/realm/validator.tspackages/core-kit/src/domains/robot/validator.tspackages/core-kit/src/domains/role/validator.tspackages/core-kit/src/domains/scope/validator.tspackages/core-kit/src/domains/user/validator.tspackages/kit/src/template.ts
💤 Files with no reviewable changes (1)
- packages/client-web-kit/src/components/utility/pagination/APagination.ts
| hide(el: symbol) { | ||
| if (typeof toast.remove !== 'undefined') { | ||
| toast.remove(el); | ||
| const item = toast.store.value.find((i) => i._self === el); | ||
| if (item) { | ||
| item.promise.resolve(new Event('hide') as any); | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
In bootstrap-vue-next, are toast.store.value[*]._selfanditem.promise.resolve(...)part of the public API for hiding toasts, or should only documentedhide/remove methods be used?
💡 Result:
In bootstrap-vue-next, toast.store.value[*]._self and item.promise.resolve(...) are not part of the public API for hiding toasts. Only the documented methods like hide, remove, and destroy should be used. The official documentation for useToast explicitly shows examples using toast.destroy for programmatic hiding after calling create (which returns a symbol/object with control methods). It mentions a remove method requiring a unique ID provided to create, and create returns a promise resolved on close. Individual toast instances expose methods like hide via slots. No documentation or examples reference toast.store, ._self, or direct promise.resolve. These appear to be internal implementation details, likely from the source code (e.g., a reactive store array and private instance/promise properties), which are not intended for public use. Using internals risks breakage across versions, as the library is still in alpha with ongoing changes (evident from GitHub issues).
Citations:
- 1: https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/composables/useToast.html
- 2: https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/toast.html
- 3: https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/toast
🏁 Script executed:
# Check the actual implementation in toast.ts
cat -n apps/client-web/composables/toast.ts | head -50Repository: authup/authup
Length of output: 1757
🏁 Script executed:
# Look for bootstrap-vue-next imports and see what's available
rg "bootstrap-vue-next" apps/client-web/composables/toast.ts -A 3 -B 1Repository: authup/authup
Length of output: 289
🏁 Script executed:
# Check if there's any documentation or config about the toast API
find . -type f -name "*.md" -o -name "*.json" | xargs grep -l "bootstrap-vue-next" 2>/dev/null | head -5Repository: authup/authup
Length of output: 153
🏁 Script executed:
# Check bootstrap-vue-next version in package.json
grep -A 5 -B 5 "bootstrap-vue-next" apps/client-web/package.jsonRepository: authup/authup
Length of output: 427
🏁 Script executed:
# Search for other uses of toast in the codebase to understand usage patterns
rg "useToast|toast\.(show|hide|remove|destroy)" apps/client-web --type ts --type vue -B 1 -A 2Repository: authup/authup
Length of output: 84
🏁 Script executed:
# Check if there's any documentation about the toast API in comments or README
rg "toast|Toast" apps/client-web/README.md -A 3 -B 1 2>/dev/null || echo "No README found in apps/client-web"Repository: authup/authup
Length of output: 91
🏁 Script executed:
# Search for usages of hide() method being called
rg "\.hide\(" apps/client-web --type ts -B 2 -A 1Repository: authup/authup
Length of output: 39
🏁 Script executed:
# Check if toast.destroy is used anywhere in the codebase
rg "toast\.(destroy|remove)" apps/client-web --type ts -B 1 -A 1Repository: authup/authup
Length of output: 39
🏁 Script executed:
# Look at the actual package to see what methods useToast should export
# Check node_modules or installed bootstrap-vue-next to understand public API
python3 <<'EOF'
import json
import subprocess
# Try to find the bootstrap-vue-next types or source
result = subprocess.run(
["find", "node_modules/bootstrap-vue-next", "-name", "index.d.ts", "-o", "-name", "useToast*"],
capture_output=True, text=True, timeout=10
)
if result.stdout:
print("Found bootstrap-vue-next files:")
print(result.stdout)
else:
print("Could not find bootstrap-vue-next in node_modules")
EOFRepository: authup/authup
Length of output: 106
🏁 Script executed:
# Search for how the symbol returned from show() is used elsewhere in the codebase
rg "useToast\(\)" apps/client-web --type ts -A 10 | head -60Repository: authup/authup
Length of output: 766
🏁 Script executed:
# Get more context on the show method and what it returns
cat -n apps/client-web/composables/toast.ts | sed -n '22,47p'Repository: authup/authup
Length of output: 943
🏁 Script executed:
# Search for any imports or usage of destroy/remove methods from toast
rg "destroy|remove" apps/client-web/composables --type ts -B 2 -A 2Repository: authup/authup
Length of output: 39
🏁 Script executed:
# Check if there are any test files that show expected usage patterns
find apps/client-web -name "*.test.ts" -o -name "*.spec.ts" | xargs grep -l "toast" 2>/dev/nullRepository: authup/authup
Length of output: 41
🏁 Script executed:
# Look for any TypeScript type definitions or interfaces for ToastOrchestratorParam
rg "ToastOrchestratorParam|useToast" apps/client-web --type ts -B 5 -A 10 | head -80Repository: authup/authup
Length of output: 2193
Refactor show() and hide() to use bootstrap-vue-next's documented API instead of internal store fields.
Lines 16–20 and 32–46 rely on accessing internal implementation details: toast.store.value, _self, and promise.resolve, which are not part of bootstrap-vue-next's public API. According to the library documentation, you should use documented methods like create(), remove(), or destroy(). This coupling is brittle and will break when the library updates (especially since v0.44.0 is still in active development).
Refactor both methods to use the officially documented API:
- Replace
toast.show()calls withtoast.create()to get a proper toast ID/handle - Replace the manual store lookup in
hide()withtoast.remove(id)or equivalent documented method
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/client-web/composables/toast.ts` around lines 16 - 20, The current
show() and hide() implementations access internal bootstrap-vue-next internals
(toast.store.value, _self, promise.resolve); change show() to call the
documented toast.create(...) API and capture the returned toast id/handle (store
that id on the created toast object or in your local state), and change hide(el:
symbol) to call the documented toast.remove(id) or toast.destroy(id) using that
stored id instead of iterating toast.store or touching promise.resolve; update
any other code that expects the old promise/_self behavior to use the public
handle/id returned by toast.create().
| ctx.vueApp.use(createBootstrap({ | ||
| toast: true, | ||
| popover: true, | ||
| orchestrator: true, | ||
| })); |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
bootstrap-vue-next createBootstrap orchestrator option
💡 Result:
There is no "orchestrator" option directly in the createBootstrap function of bootstrap-vue-next. The createBootstrap plugin (legacy approach) primarily accepts a "components" configuration object for setting global default prop values across components, as shown in the official documentation. createBootstrap({ components: { global: { type: 'grow' }, BButton: { variant: 'primary' } } }) The orchestrator functionality (BOrchestrator component, which manages modals, toasts, popovers, etc.) is automatically included when using createBootstrap, but requires manually adding to your root App.vue template. The modern/recommended approach uses the BApp root component instead of createBootstrap, which includes built-in orchestrator integration automatically (no manual BOrchestrator needed). BApp accepts a "defaults" prop equivalent to createBootstrap's components config, plus options like teleport-to, no-orchestrator (boolean to disable), rtl, etc. For tree-shaking in plugin mode, individual plugins like orchestratorPlugin can be imported selectively instead of the full createBootstrap. An open GitHub issue discusses rethinking createBootstrap and orchestrator injection, confirming orchestrators are handled separately via composables/controllers in the plugin setup.
Citations:
- 1: RFC: Rethink the composables, createBootstrap and how we inject/provide bootstrap-vue-next/bootstrap-vue-next#2708
- 2: https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/configurations/global-options
- 3: https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs
- 4: https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/app.html
- 5: https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components
Fix invalid orchestrator option in createBootstrap configuration.
The orchestrator: true option is not a valid parameter for createBootstrap() in bootstrap-vue-next. The orchestrator functionality must be configured separately:
- Add the
<BOrchestrator />component to your root App.vue template, or - Switch to using the
BAppcomponent (recommended) which includes built-in orchestrator support, or - Import and use the
orchestratorPluginseparately if needed
The previous configuration (toast: true, popover: true) was also not a valid API for this plugin. Update this to use the correct approach for your application structure.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/client-web/plugins/bootstrap.ts` around lines 15 - 17, The
createBootstrap call in bootstrap.ts is passing an invalid option (orchestrator:
true) — remove the orchestrator (and any other invalid options like
toast/popover) from the createBootstrap(...) configuration used in
ctx.vueApp.use(createBootstrap(...)); then enable orchestrator via one of the
supported approaches: add the <BOrchestrator /> component into your root App.vue
template, or replace your root with the BApp component (recommended) which has
orchestrator built-in, or import/use the orchestratorPlugin separately; keep the
invocation of createBootstrap without unsupported options and adjust App.vue to
include BOrchestrator or switch to BApp accordingly.
| query = rctx.query as BuildInput<RECORD>; | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
In rapiq version 0.9.0, what is the exact TypeScript definition of BuildInput<T>, and are filtersandfields valid top-level keys?
💡 Result:
In rapiq version 0.9.0, the exact TypeScript definition of BuildInput<T> is: export type BuildInput<V extends Record<string, any>> = { [T in Parameter | URLParameter]?: BuildParameterInput<T, V> } where Parameter is an enum that includes FILTERS = 'filters' and FIELDS = 'fields'. Yes, filters and fields are valid top-level keys, as demonstrated in official usage examples: const record: BuildInput<User> = { pagination: { limit: 20, offset: 10 }, filters: { id: 1 }, fields: ['id', 'name'], sort: '-id', relations: ['realm'] }; This structure is consistent across versions including 0.9.0, as shown in npm package documentation and predecessor @trapi/query which defines the same type.
Citations:
- 1: https://www.npmjs.com/package/rapiq
- 2: https://www.npmjs.com/package/@trapi/query
- 3: https://registry.npmjs.org/rapiq
- 4: https://github.com/tada5hi/rapiq
- 5: https://unpkg.com/[email protected]/
🏁 Script executed:
wc -l packages/client-web-kit/src/components/utility/entity/record/module.tsRepository: authup/authup
Length of output: 131
🏁 Script executed:
sed -n '290,335p' packages/client-web-kit/src/components/utility/entity/record/module.ts | cat -nRepository: authup/authup
Length of output: 1531
🏁 Script executed:
grep -r "ResourceManagerResolveContext" packages/client-web-kit/src --include="*.ts" | head -5Repository: authup/authup
Length of output: 742
🏁 Script executed:
sed -n '1,50p' packages/client-web-kit/src/components/utility/entity/record/module.ts | cat -nRepository: authup/authup
Length of output: 2143
🏁 Script executed:
sed -n '/export type ResourceManagerResolveContext/,/^}/p' packages/client-web-kit/src/components/utility/entity/record/types.ts | head -20Repository: authup/authup
Length of output: 196
Avoid as any query mutations; align with typecheck hardening objective.
Lines 322 and 327 use as any casts, which directly contradicts this PR's goal of enabling stricter typechecks. While filters and fields are valid BuildInput<T> top-level keys (confirmed in rapiq v0.9.0), the type inference issue can be resolved through immutable object composition instead of runtime type bypasses. Additionally, the initial cast at line 298 is redundant since rctx.query is already typed as BuildInput<RECORD>.
Proposed typed refactor
let query : BuildInput<RECORD> | undefined;
if (rctx.query) {
- query = rctx.query as BuildInput<RECORD>;
+ query = { ...(rctx.query) };
}
if (ctx.props.queryFilters) {
- query = query || {} as BuildInput<RECORD>;
- (query as any).filters = ctx.props.queryFilters;
+ query = {
+ ...(query ?? {}),
+ filters: ctx.props.queryFilters,
+ };
}
if (ctx.props.queryFields) {
- query = query || {} as BuildInput<RECORD>;
- (query as any).fields = ctx.props.queryFields;
+ query = {
+ ...(query ?? {}),
+ fields: ctx.props.queryFields,
+ };
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/client-web-kit/src/components/utility/entity/record/module.ts`
around lines 298 - 299, Remove the redundant cast on rctx.query (it's already
BuildInput<RECORD>) and stop using `as any` when adding filters/fields; instead
construct a new typed BuildInput<RECORD> object immutably (e.g., const query:
BuildInput<RECORD> = { ...rctx.query, filters: newFilters, fields: newFields })
so the additions to `filters` and `fields` preserve types; update the code in
this module to use that new `query` value wherever `query` was mutated
(referencing rctx.query, the local query variable, and the `filters`/`fields`
properties) to satisfy strict typechecks without runtime casts.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@packages/client-web-kit/src/components/entities/identity-provider/AIdentityProviderIcon.ts`:
- Around line 25-27: The setup function is destructuring props (const { preset }
= props and const { protocol } = props) which snapshots reactive values and
causes stale ids; update the setup for AIdentityProviderIcon to stop
destructuring and instead read props.entity.preset and props.entity.protocol
directly inside the returned render function (where you create
AIdentityProviderPreset and the protocol child) so the id props remain reactive
when parent updates entity.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 03bbdd7a-c2e2-4b85-91a0-2269139d344c
📒 Files selected for processing (3)
packages/client-web-kit/src/components/entities/identity-provider/AIdentityProviderIcon.tspackages/client-web-kit/src/core/socket-manager/install.tspackages/kit/src/template.ts
| const { preset } = props.entity; | ||
| return () => h(AIdentityProviderPreset, { | ||
| id: props.entity.preset, | ||
| id: preset, |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
In Vue 3, if a value is destructured from props in setup (outside render/computed), does it remain reactive when props change?
💡 Result:
No, in Vue 3, if a value is destructured from props in setup (outside render/computed), it does not remain reactive when props change in versions before 3.5. The destructured value becomes a plain JavaScript value, losing its connection to the reactive props proxy. Since today is 2026-03-24 and Vue 3.5 (released earlier) stabilizes "Reactive Props Destructure," direct destructuring from defineProps in <script setup> now remains reactive via compiler transformation (accesses are rewritten to props.xxx). The question likely refers to the classic setup(props) function or pre-3.5 behavior, where destructuring { foo } = props; loses reactivity. Official docs explicitly warn: "if you destructure the props object, the destructured variables will lose reactivity." To maintain reactivity when destructuring: - Use toRefs(props) or toRef(props, 'foo') - Access via props.foo directly - In <script setup> with Vue 3.5+, destructure defineProps directly
Citations:
- 1: https://vuejs.org/api/composition-api-setup
- 2: https://v3.vuejs.org/guide/component-props.html
- 3: https://blog.vuejs.org/posts/vue-3-5
🏁 Script executed:
cat -n packages/client-web-kit/src/components/entities/identity-provider/AIdentityProviderIcon.ts | head -50Repository: authup/authup
Length of output: 1848
🏁 Script executed:
cat -n packages/client-web-kit/package.json | grep -A 5 -B 5 '"vue"'Repository: authup/authup
Length of output: 1090
🏁 Script executed:
# Find the root package.json to check Vue version
cat -n package.json | grep -A 2 -B 2 '"vue"'Repository: authup/authup
Length of output: 39
Avoid snapshotting reactive props in setup-scoped constants.
This file uses classic setup(props) which loses reactivity when destructuring from props. Lines 25 and 37 capture preset and protocol once, so if the parent component updates entity, the id prop passed to child components will remain stale. In Vue 3, the reactive destructuring feature stabilized in 3.5 applies only to <script setup>; classic setup() functions must access props directly to maintain reactivity.
🔧 Suggested fix
if (props.entity.preset) {
- const { preset } = props.entity;
return () => h(AIdentityProviderPreset, {
+ id: props.entity.preset!,
- id: preset,
}, {
default: (item: IdentityProviderPresetElement) => h('i', { class: [item.icon, setup.attrs.class] }),
});
}
if (!props.entity.protocol) {
return () => null;
}
- const { protocol } = props.entity;
return () => h(AIdentityProviderProtocol, {
- id: protocol,
+ id: props.entity.protocol,
}, {
default: (item: IdentityProviderProtocolElement) => h('i', { class: [item.icon, setup.attrs.class] }),
});Also applies to: 37-39
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@packages/client-web-kit/src/components/entities/identity-provider/AIdentityProviderIcon.ts`
around lines 25 - 27, The setup function is destructuring props (const { preset
} = props and const { protocol } = props) which snapshots reactive values and
causes stale ids; update the setup for AIdentityProviderIcon to stop
destructuring and instead read props.entity.preset and props.entity.protocol
directly inside the returned render function (where you create
AIdentityProviderPreset and the protocol child) so the id props remain reactive
when parent updates entity.
There was a problem hiding this comment.
♻️ Duplicate comments (2)
packages/client-web-kit/src/components/entities/user/AUserPasswordForm.ts (1)
60-62:⚠️ Potential issue | 🟠 MajorAvoid silent submit no-op when
idis missing.At Line 60, returning silently drops the action with no feedback (
failedis never emitted), and the submit button can remain enabled despite being unsendable. Please emit a failure and gate submit availability.Suggested fix
const submit = wrapFnWithBusyState(busy, async () => { if (!props.id) { - return; + ctx.emit('failed', new Error('User id is required to update password.')); + return; } try { const user = await apiClient.user.update(props.id, { password: form.password, password_repeat: form.password_repeat, }); ctx.emit('updated', user);const submitButton = buildFormSubmitWithTranslations({ submit, isEditing: true, - invalid: $v.value.$invalid, + invalid: $v.value.$invalid || !props.id, }, submitTranslations);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/client-web-kit/src/components/entities/user/AUserPasswordForm.ts` around lines 60 - 62, The submit early-return in AUserPasswordForm when props.id is falsy silently drops the action; update the submit handler (the function that currently checks "if (!props.id) { return; }") to emit the failure event (call emit('failed', { reason: 'missing id' }) or existing failure helper) so consumers see the error, and also add a guard on the form submit control (the submit button binding in this component) to disable it when props.id is missing (e.g., :disabled="!props.id" or equivalent reactive check) so the user cannot attempt to submit without an id.apps/client-web/composables/toast.ts (1)
13-37:⚠️ Potential issue | 🟠 MajorUse bootstrap-vue-next’s documented
create()path instead ofshow()here.On Line 20 and the subsequent calls (Lines 25 and 30), this wrapper depends on
toast.showand a{ props: ... }payload shape. That API shape is brittle for orchestrated toasts and can break on library updates; the documented programmatic flow iscreate(...)with a direct toast param object.♻️ Proposed fix
export function useToast() { const toast = useBaseToast(); return { show( el: string | ToastOrchestratorParam, options: ToastOrchestratorParam = {}, ) { - if (typeof toast.show === 'undefined') { + if (typeof toast.create === 'undefined') { return undefined; } if (isObject(el)) { - return toast.show({ - props: { position: 'top-center', ...el }, - }); + return toast.create({ + position: 'top-center', + ...el, + }); } - return toast.show({ - props: { - position: 'top-center', - ...options, - body: el, - }, - }); + return toast.create({ + position: 'top-center', + ...options, + body: el, + }); }, }; }In the latest bootstrap-vue-next docs for `useToast()`, what are the documented public methods for programmatically showing and hiding a toast? Specifically, is `show()` public, or should `create()` and the returned handle methods (e.g., `destroy()`) be used?🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/client-web/composables/toast.ts` around lines 13 - 37, The wrapper's show function should use the toast.create(...) programmatic API instead of relying on toast.show and a { props: ... } payload; update the show implementation (the exported show method in this file that calls useBaseToast()) to call toast.create with a direct toast parameter object (position, body, other options) and return the created handle (so callers can call handle.destroy() etc.), and remove the brittle { props: ... } shape / typeof toast.show checks—use ToastOrchestratorParam to build the param passed into toast.create and fall back correctly when el is an object or a string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@apps/client-web/composables/toast.ts`:
- Around line 13-37: The wrapper's show function should use the
toast.create(...) programmatic API instead of relying on toast.show and a {
props: ... } payload; update the show implementation (the exported show method
in this file that calls useBaseToast()) to call toast.create with a direct toast
parameter object (position, body, other options) and return the created handle
(so callers can call handle.destroy() etc.), and remove the brittle { props: ...
} shape / typeof toast.show checks—use ToastOrchestratorParam to build the param
passed into toast.create and fall back correctly when el is an object or a
string.
In `@packages/client-web-kit/src/components/entities/user/AUserPasswordForm.ts`:
- Around line 60-62: The submit early-return in AUserPasswordForm when props.id
is falsy silently drops the action; update the submit handler (the function that
currently checks "if (!props.id) { return; }") to emit the failure event (call
emit('failed', { reason: 'missing id' }) or existing failure helper) so
consumers see the error, and also add a guard on the form submit control (the
submit button binding in this component) to disable it when props.id is missing
(e.g., :disabled="!props.id" or equivalent reactive check) so the user cannot
attempt to submit without an id.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 66136751-3120-4581-916e-6c352c3a649d
📒 Files selected for processing (2)
apps/client-web/composables/toast.tspackages/client-web-kit/src/components/entities/user/AUserPasswordForm.ts
Summary by CodeRabbit
Bug Fixes
Improvements
Chores