refactor(web): source the search result bound from its protocol constant
`ConnectionHandle.sessionSearchResultLimit` mirrored `SESSION_SEARCH_RESULT_LIMIT` as per-connection state, giving one fact two homes in the same module and implying a transport-varying or server-negotiated bound that the response schema's fixed `max` forbids. `SessionsService` now reads the constant directly and its constructor drops the parameter; the connection handle and its unreachable `/client` value re-export go away. The import comes from the inline-safe wire layer rather than the connection plugin's `/client` surface, which the bundle-purity gate rejects for value imports.
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
*/
|
||||
import type { Context } from 'cordis'
|
||||
import type { IApiClient } from './api.ts'
|
||||
import { SESSION_SEARCH_RESULT_LIMIT } from './api.ts'
|
||||
import { ConnectionController, type ConnectionConfig, type ConnectionSinks, type ConnectionState } from './connection.ts'
|
||||
import { FixtureApiClient } from './fixture.ts'
|
||||
import { WebApiClient } from './web-api-client.ts'
|
||||
@@ -24,7 +23,6 @@ export type {
|
||||
} from './api.ts'
|
||||
export {
|
||||
RpcId,
|
||||
SESSION_SEARCH_RESULT_LIMIT,
|
||||
AbstractApiClient,
|
||||
transportError,
|
||||
} from './api.ts'
|
||||
@@ -45,8 +43,6 @@ export const inject: string[] = []
|
||||
export interface ConnectionHandle {
|
||||
/** Shared api client (fixture or real, decided at boot from the page URL). */
|
||||
readonly api: IApiClient
|
||||
/** Protocol-owned maximum rows for one session-search response. */
|
||||
readonly sessionSearchResultLimit: number
|
||||
/**
|
||||
* Start the connect/pump/reconnect loop with the consumer's frame sinks.
|
||||
* One consumer owns the streams (the runtime object layer); a second call
|
||||
@@ -68,7 +64,6 @@ export function apply(ctx: Context): void {
|
||||
let started = false
|
||||
const handle: ConnectionHandle = {
|
||||
api,
|
||||
sessionSearchResultLimit: SESSION_SEARCH_RESULT_LIMIT,
|
||||
start(sinks, config) {
|
||||
if (started) throw new Error('connection: the stream loop is already owned by another consumer')
|
||||
started = true
|
||||
|
||||
Reference in New Issue
Block a user