diff --git a/src/components/map-projects/MapProject.jsx b/src/components/map-projects/MapProject.jsx index 4ff62b0..115e736 100644 --- a/src/components/map-projects/MapProject.jsx +++ b/src/components/map-projects/MapProject.jsx @@ -125,6 +125,7 @@ import { normalizeLookupConfig } from './lookupConfigFields' import { getDeclaredLocales, getDefaultTargetRepoVersion, getProjectTargetRepoVersion, getSavedTargetRepoVersion, getTargetRepoVersionFromUrl, getTargetRepoVersionId } from './projectTargetRepo' import { buildBridgeTargetDownloadEntries, buildQualityRowViews, conceptBelongsToTargetRepo, conceptForMapping, findTargetRowView, formatBridgeTargetDownloadEntry, resolveAICandidateID, getScoreDetails, getAIAnalysisCandidateIDs, getAIIndicatorTooltip, withCachedConcept, withCandidateNames, buildMatchEntries, restoredNote, withOwnNames, withSavedMatch } from './viewBuilders.js' import { formatClockTime, getCapacityWaitLabel, mergeCapacityWaits } from './rowProgress.js' +import { createMappedSourcesReader, MAPPED_SOURCES_PAGE_SIZE, probeBridgeMappedSources } from './mappedSources' import './MapProject.scss' import '../common/ResizablePanel.scss' @@ -153,6 +154,11 @@ import '../common/ResizablePanel.scss' const NEW_PROJECT_BLOCK_ERROR_CODES = {access: 'mapper_access_denied', projects_not_entitled: 'mapper_projects_not_entitled', projects: 'mapper_projects_limit_reached'} const MAPPER_QUOTA_SURFACE = {match_operations: 'auto_match', ai_assistant_calls: 'auto_match', projects: 'new_project', rows: 'import'} +// Raw, so a failed or throttled read settles and isn't kept. +const fetchMappedSourcesPage = (url, page) => APIService.new().overrideURL(url).appendToUrl('mapped-sources/').get(null, null, { + excludeSelf: false, brief: true, limit: MAPPED_SOURCES_PAGE_SIZE, offset: (page - 1) * MAPPED_SOURCES_PAGE_SIZE, page +}, true) + const MapProject = () => { const { t } = useTranslation(); const { toggles, setAlert: baseSetAlert, setProjectRowSearch } = React.useContext(OperationsContext); @@ -493,6 +499,10 @@ const MapProject = () => { const [showTargetRepoVersionError, setShowTargetRepoVersionError] = React.useState(false) const [mappedSources, setMappedSources] = React.useState([]) const [bridgeMappedSources, setBridgeMappedSources] = React.useState({}) + // One read of each version's list, shared by the target and the bridge probe. + const [readMappedSources] = React.useState(() => createMappedSourcesReader(fetchMappedSourcesPage)) + const stopTargetMappedSourcesRef = React.useRef(() => {}) + React.useEffect(() => () => stopTargetMappedSourcesRef.current(), []) const [locales, setLocales] = React.useState([]) const [versions, setVersions] = React.useState([]) const [conceptCache, setConceptCache] = React.useState({}) @@ -870,38 +880,21 @@ const MapProject = () => { } }, [repoVersion, project]) - React.useEffect(() => { - if(!bridgeProbeAlgo?.id) - return - - const bridgeUrl = bridgeProbeAlgo?.target_repo_url - if(!bridgeUrl) - return - - if(bridgeProbeAlgo.target_repo_version) { - fetchMappedSources(bridgeUrl + bridgeProbeAlgo.target_repo_version + '/', sources => - setBridgeMappedSources(prev => ({...prev, [bridgeUrl]: sources}))) - return - } - - const resolveNamespace = namespace || get(project, 'owner_url') || owner - APIService.new() + // Runs again only when an input it uses changes, not on every project change. + const bridgeNamespace = namespace || get(project, 'owner_url') || owner + React.useEffect(() => probeBridgeMappedSources({ + algo: bridgeProbeAlgo, + selected: bridgeEnabled, + namespace: bridgeNamespace, + resolveVersion: (bridgeUrl, resolveNamespace) => APIService.new() .overrideURL('/$resolveReference/') - .post([{url: bridgeUrl}], currentUserToken(), null, resolveNamespace ? {namespace: resolveNamespace} : undefined) - .then(response => { - const resolvedVersion = get(response, 'data.0.result.version', '') - if(!resolvedVersion) - return - - if(bridgeEnabled) - setAlgosSelected(prev => prev.map(algo => - algo?.id === bridgeProbeAlgo.id ? {...algo, target_repo_version: resolvedVersion} : algo - )) - fetchMappedSources(bridgeUrl + resolvedVersion + '/', sources => - setBridgeMappedSources(prev => ({...prev, [bridgeUrl]: sources}))) - }) - .catch(() => {}) - }, [bridgeProbeAlgo?.id, bridgeProbeAlgo?.target_repo_url, bridgeProbeAlgo?.target_repo_version, bridgeEnabled, namespace, project, owner]) + .post([{url: bridgeUrl}], currentUserToken(), null, resolveNamespace ? {namespace: resolveNamespace} : undefined, true), + readMappedSources, + pinVersion: (algoId, version) => setAlgosSelected(prev => prev.map(algo => + algo?.id === algoId ? {...algo, target_repo_version: version} : algo + )), + onSources: (bridgeUrl, sources) => setBridgeMappedSources(prev => ({...prev, [bridgeUrl]: sources})) + }), [bridgeProbeAlgo?.id, bridgeProbeAlgo?.target_repo_url, bridgeProbeAlgo?.target_repo_version, bridgeEnabled, bridgeNamespace]) const createProjectFromTemplate = () => { @@ -2170,40 +2163,15 @@ const MapProject = () => { const fetchRepo = (url, _repo) => APIService.new().overrideURL(url).get().then(response => setRepo(response.data?.id ? response.data : _repo)) - const fetchMappedSources = (url, setter) => { - let limit = 25 - - const recurse = (offset, page, fetchedSoFar, accumulated) => { - _fetchMappedSources(url, limit, offset, page, response => { - const data = response?.data || [] - const updated = [...accumulated, ...data] - - setter(updated) - - const fetched = fetchedSoFar + data.length - const numFound = parseInt(response?.headers?.num_found || 0) - - if (fetched < numFound) { - recurse(offset + limit, page + 1, fetched, updated) - } - }) - } - - recurse(0, 1, 0, []) - } - - const _fetchMappedSources = ( - url, limit, offset, page, callback - ) => { - APIService.new().overrideURL(url).appendToUrl('mapped-sources/').get(null, null, {excludeSelf: false, brief: true, limit: limit || 25, offset: offset || 0, page: page || 1}).then(callback) - } - const onRepoVersionChange = version => { setRepoVersion(version || false) setShowTargetRepoVersionError(false) + // A slower read of an earlier version doesn't overwrite this one's list. + stopTargetMappedSourcesRef.current() + stopTargetMappedSourcesRef.current = () => {} if(version?.version_url) { setLocales(getDeclaredLocales(version)) - fetchMappedSources(version.version_url, setMappedSources) + stopTargetMappedSourcesRef.current = readMappedSources(version.version_url, setMappedSources) updateAlgosByRepoVersion(version) } else { setMappedSources([]) @@ -3063,7 +3031,7 @@ const MapProject = () => { const fetchVersions = (url, savedVersion) => { const request = ++versionsRequestRef.current APIService.new().overrideURL(dropVersion(url)).appendToUrl('versions/?verbose=true').get().then(response => { - if(request !== versionsRequestRef.current) + if(request !== versionsRequestRef.current || !isMountedRef.current) return let _versions = response.data setVersions(_versions) diff --git a/src/components/map-projects/__tests__/mappedSources.test.js b/src/components/map-projects/__tests__/mappedSources.test.js new file mode 100644 index 0000000..6f99c69 --- /dev/null +++ b/src/components/map-projects/__tests__/mappedSources.test.js @@ -0,0 +1,320 @@ +/** + * The Mapper reads a repository version's mapped-sources list once and shares + * it between the bridge probe and the target version + * (OpenConceptLab/ocl_issues#3064). + */ + +import test from 'node:test' +import assert from 'node:assert/strict' +import { readFileSync } from 'node:fs' +import babel from '@babel/core' + +import { createMappedSourcesReader, probeBridgeMappedSources } from '../mappedSources.js' + +const CIEL = '/orgs/CIEL/sources/CIEL/' +const CIEL_RELEASE = '/orgs/CIEL/sources/CIEL/v2026-09-24/' +const NO_WAIT = {maxRetries: 2, baseDelayMs: 0} + +// Failed answers as APIService gives them in raw mode. +const httpError = status => ({isAxiosError: true, response: {status}}) +const networkError = {isAxiosError: true, code: 'ERR_NETWORK'} + +const sourcesPage = (page, numFound) => ({ + data: Array.from({length: Math.min(25, numFound - (page - 1) * 25)}, (_, i) => ({url: `/orgs/X/sources/S${(page - 1) * 25 + i}/`})), + headers: {num_found: String(numFound)} +}) + +// A fake API that answers each page once `settle()` runs, and counts the +// reads. `answer(url, page, n)` can replace the n-th read's answer. +const fakeAPI = (numFound = 50, answer = () => undefined) => { + const reads = [] + const pending = [] + const fetchPage = (url, page) => { + reads.push(`${url}#${page}`) + const n = reads.length + return new Promise(resolve => pending.push(() => resolve(answer(url, page, n) || sourcesPage(page, numFound)))) + } + const settle = async () => { + for(let idle = 0; idle < 5;) { + await new Promise(resolve => setTimeout(resolve, 0)) + if(pending.length) { + idle = 0 + pending.splice(0).forEach(resolve => resolve()) + } else { + idle++ + } + } + } + return {fetchPage, reads, settle} +} + +const readerFor = api => createMappedSourcesReader(api.fetchPage, NO_WAIT) + +test('the bridge probe and the target share one read of each page of the same version', async () => { + const api = fakeAPI(50) + const read = readerFor(api) + const lists = {bridge: [], target: []} + + read(CIEL_RELEASE, list => lists.bridge.push(list.length)) + read(CIEL_RELEASE, list => lists.target.push(list.length)) + await api.settle() + + assert.deepEqual(api.reads, [`${CIEL_RELEASE}#1`, `${CIEL_RELEASE}#2`]) + // Each still gets the list page by page, as before. + assert.deepEqual(lists.bridge, [25, 50]) + assert.deepEqual(lists.target, [25, 50]) +}) + +test('asking again for a version already read reads nothing more', async () => { + const api = fakeAPI(50) + const read = readerFor(api) + read(CIEL_RELEASE, () => {}) + await api.settle() + + let last + read(CIEL_RELEASE, list => { last = list }) + read(CIEL_RELEASE.replace(/\/$/, ''), () => {}) + await api.settle() + + assert.equal(api.reads.length, 2) + assert.equal(last.length, 50) +}) + +test('another version is read on its own', async () => { + const api = fakeAPI(10) + const read = readerFor(api) + read(CIEL_RELEASE, () => {}) + read(`${CIEL}v2026-10-23/`, () => {}) + await api.settle() + + assert.deepEqual(api.reads, [`${CIEL_RELEASE}#1`, `${CIEL}v2026-10-23/#1`]) +}) + +test('a repository\'s HEAD is one version, at its own URL or at HEAD/', async () => { + // The versions list gives HEAD the repository's URL; a bridge resolved to + // HEAD asks for /HEAD/. + const api = fakeAPI(10) + const read = readerFor(api) + const lists = [] + read(CIEL, list => lists.push(list.length)) + read(`${CIEL}HEAD/`, list => lists.push(list.length)) + await api.settle() + + assert.deepEqual(api.reads, [`${CIEL}#1`]) + assert.deepEqual(lists, [10, 10]) +}) + +test('a version id the API encodes in its URL is read apart from the bare id', async () => { + // The server can read a bare `+` differently from the API's encoded form, + // so sharing them could give one caller the other's failed read. + const api = fakeAPI(10) + const read = readerFor(api) + read(`${CIEL}1.2.3+build.1/`, () => {}) + read(`${CIEL}1.2.3%252Bbuild.1/`, () => {}) + await api.settle() + + assert.deepEqual(api.reads, [`${CIEL}1.2.3+build.1/#1`, `${CIEL}1.2.3%252Bbuild.1/#1`]) +}) + +test('a failed page gives what was read so far and is read again on the next ask', async () => { + let failing = true + const api = fakeAPI(50, (_, page) => failing && page === 2 ? httpError(404) : undefined) + const read = readerFor(api) + const lists = [] + read(CIEL_RELEASE, list => lists.push(list.length)) + await api.settle() + // A 404 isn't tried again. + assert.deepEqual(lists, [25, 25]) + + failing = false + const retried = [] + read(CIEL_RELEASE, list => retried.push(list.length)) + await api.settle() + + // Page 1 came back, so only page 2 is asked for again. + assert.deepEqual(api.reads, [`${CIEL_RELEASE}#1`, `${CIEL_RELEASE}#2`, `${CIEL_RELEASE}#2`]) + assert.deepEqual(retried, [25, 50]) +}) + +test('a throttled page is read again when the version is chosen again', async () => { + const api = fakeAPI(10, (_, __, n) => n === 1 ? httpError(429) : undefined) + const read = readerFor(api) + const lists = [] + read(CIEL_RELEASE, list => lists.push(list.length)) + await api.settle() + assert.deepEqual(lists, [0]) + + read(CIEL_RELEASE, list => lists.push(list.length)) + await api.settle() + + assert.equal(api.reads.length, 2) + assert.deepEqual(lists, [0, 10]) +}) + +test('a network error or a 5xx is tried again, at most twice', async () => { + const api = fakeAPI(10, (_, __, n) => [networkError, httpError(503)][n - 1]) + const lists = [] + readerFor(api)(CIEL_RELEASE, list => lists.push(list.length)) + await api.settle() + assert.equal(api.reads.length, 3) + assert.deepEqual(lists, [10]) + + const failing = fakeAPI(10, () => httpError(503)) + const failed = [] + readerFor(failing)(CIEL_RELEASE, list => failed.push(list.length)) + await failing.settle() + assert.equal(failing.reads.length, 3) + assert.deepEqual(failed, [0]) +}) + +test('a page isn\'t tried again once no read waits for it', async () => { + const api = fakeAPI(10, () => httpError(503)) + const read = readerFor(api) + const stopBridge = read(CIEL_RELEASE, () => {}) + const stopTarget = read(CIEL_RELEASE, () => {}) + stopBridge() + stopTarget() + await api.settle() + + assert.equal(api.reads.length, 1) +}) + +test('a stopped read gives nothing more', async () => { + const api = fakeAPI(50) + const read = readerFor(api) + const lists = [] + const stop = read(CIEL_RELEASE, list => lists.push(list.length)) + stop() + await api.settle() + + assert.deepEqual(lists, []) +}) + +// The bridge probe, with a fake $resolveReference that answers as APIService +// does in raw mode. +const resolved = version => ({data: [{result: {version}}]}) +const probeWith = ({algo, selected = false, namespace = '/users/jontest1/', answers = [resolved('v2026-09-24')]}) => { + const api = fakeAPI(50) + const resolves = [] + const pins = [] + const sources = {} + const stop = probeBridgeMappedSources({ + algo, + selected, + namespace, + resolveVersion: (url, ns) => { + resolves.push([url, ns]) + return Promise.resolve(answers[Math.min(resolves.length, answers.length) - 1]) + }, + readMappedSources: readerFor(api), + pinVersion: (id, v) => pins.push([id, v]), + onSources: (url, list) => { sources[url] = list.length }, + retry: NO_WAIT + }) + return {api, resolves, pins, sources, stop} +} + +test('a bridge algorithm with a version reads that version without resolving', async () => { + const probe = probeWith({algo: {id: 'b', target_repo_url: CIEL, target_repo_version: 'v2026-09-24'}}) + await probe.api.settle() + + assert.deepEqual(probe.resolves, []) + assert.deepEqual(probe.api.reads, [`${CIEL_RELEASE}#1`, `${CIEL_RELEASE}#2`]) + assert.deepEqual(probe.sources, {[CIEL]: 50}) +}) + +test('a bridge algorithm with no version reads the version it resolves to, in the namespace given', async () => { + const probe = probeWith({algo: {id: 'b', target_repo_url: CIEL}}) + await probe.api.settle() + + assert.deepEqual(probe.resolves, [[CIEL, '/users/jontest1/']]) + assert.deepEqual(probe.api.reads, [`${CIEL_RELEASE}#1`, `${CIEL_RELEASE}#2`]) + // The API's offer isn't selected: its version isn't pinned. + assert.deepEqual(probe.pins, []) +}) + +test('selecting a bridge algorithm pins its resolved version', async () => { + const probe = probeWith({algo: {id: 'b', target_repo_url: CIEL}, selected: true}) + await probe.api.settle() + + assert.deepEqual(probe.pins, [['b', 'v2026-09-24']]) +}) + +test('resolving the bridge version is tried again after a network error or a 5xx', async () => { + const probe = probeWith({algo: {id: 'b', target_repo_url: CIEL}, selected: true, answers: [httpError(503), networkError, resolved('v2026-09-24')]}) + await probe.api.settle() + + assert.equal(probe.resolves.length, 3) + assert.deepEqual(probe.pins, [['b', 'v2026-09-24']]) + assert.deepEqual(probe.sources, {[CIEL]: 50}) +}) + +test('a probe stopped before its version resolves pins, reads and retries nothing', async () => { + const probe = probeWith({algo: {id: 'b', target_repo_url: CIEL}, selected: true}) + probe.stop() + await probe.api.settle() + assert.deepEqual(probe.pins, []) + assert.deepEqual(probe.api.reads, []) + + const failing = probeWith({algo: {id: 'b', target_repo_url: CIEL}, answers: [httpError(503)]}) + failing.stop() + await failing.api.settle() + assert.equal(failing.resolves.length, 1) +}) + +test('no version, or no bridge repository, reads nothing', async () => { + for(const algo of [undefined, {id: 'b'}, {id: 'b', target_repo_url: CIEL}]) { + const probe = probeWith({algo, answers: [resolved('')]}) + await probe.api.settle() + assert.deepEqual(probe.api.reads, []) + } +}) + +// MapProject can't be mounted here (these tests run without a JSX transform), +// so this reads its source. +const source = readFileSync(new URL('../MapProject.jsx', import.meta.url), 'utf8') +const ast = babel.parseSync(source, {babelrc: false, configFile: false, parserOpts: {plugins: ['jsx']}}) +const code = node => source.slice(node.start, node.end) + +test('the bridge probe runs again only when an input it uses changes, not on every project change', () => { + const deps = [] + babel.traverse(ast, { + CallExpression({node}) { + const [effect, dependencies] = node.arguments + if(code(node.callee) === 'React.useEffect' && effect && code(effect).includes('probeBridgeMappedSources(')) + deps.push(dependencies.elements.map(code)) + } + }) + assert.deepEqual(deps, [[ + 'bridgeProbeAlgo?.id', + 'bridgeProbeAlgo?.target_repo_url', + 'bridgeProbeAlgo?.target_repo_version', + 'bridgeEnabled', + 'bridgeNamespace' + ]]) + assert.match(source, /const bridgeNamespace = namespace \|\| get\(project, 'owner_url'\) \|\| owner\n/) +}) + +test('the target version and the bridge probe read through the one shared reader, in raw mode', () => { + const readers = [] + const reads = [] + babel.traverse(ast, { + CallExpression({node}) { + if(node.callee.name === 'createMappedSourcesReader') + readers.push(code(node)) + if(node.callee.name === 'readMappedSources') + reads.push(node.arguments.map(code)) + } + }) + assert.deepEqual(readers, ['createMappedSourcesReader(fetchMappedSourcesPage)']) + assert.deepEqual(reads, [['version.version_url', 'setMappedSources']]) + assert.match(source, /readMappedSources,\n/) + // Leaving the project stops the target's read, and a versions answer that + // lands after it starts none. + assert.match(source, /if\(request !== versionsRequestRef\.current \|\| !isMountedRef\.current\)\n\s*return\n\s*let _versions/) + assert.match(source, /React\.useEffect\(\(\) => \(\) => stopTargetMappedSourcesRef\.current\(\), \[\]\)/) + // Nothing reads the list around the reader, and a throttled read settles. + assert.equal(source.match(/appendToUrl\('mapped-sources\/'\)/g).length, 1) + assert.match(source, /appendToUrl\('mapped-sources\/'\)\.get\(null, null, \{[^}]*\}, true\)/) + assert.match(source, /resolveNamespace \? \{namespace: resolveNamespace\} : undefined, true\)/) +}) diff --git a/src/components/map-projects/mappedSources.js b/src/components/map-projects/mappedSources.js new file mode 100644 index 0000000..6e41065 --- /dev/null +++ b/src/components/map-projects/mappedSources.js @@ -0,0 +1,118 @@ +// A repository version's mapped-sources list, read once per page and shared by +// everyone who asks for it while the project is open: the bridge probe and the +// target version often ask for the same version (OpenConceptLab/ocl_issues#3064). + +import { retryWithBackoff } from '../../services/retry.js' + +export const MAPPED_SOURCES_PAGE_SIZE = 25 + +// A network error or a 5xx is tried again twice, after about 3 s and 12 s. +const RETRY = {maxRetries: 2, baseDelayMs: 3000} + +// APIService in raw mode answers a failed request with the error itself. +const isTransientFailure = response => Boolean(response?.isAxiosError) && + (!response.response || response.response.status >= 500) + +// Settles with the answer, after trying again while the failure is transient. +const withRetry = (request, options) => retryWithBackoff( + () => Promise.resolve(request()).then(response => { + if(isTransientFailure(response)) + throw response + return response + }), + {...options, isRetryable: isTransientFailure} +).catch(() => null) + +const versionURL = url => `${String(url || '').replace(/\/+$/, '')}/` + +// A repository's HEAD is listed at its own URL and at /HEAD/. +// Version URLs are otherwise compared as given: the API encodes a version's id +// in its URL and the bridge's URL holds the bare id, and the server can read +// the two differently, so they aren't taken to be one version. +const versionKey = url => versionURL(url).replace(/^(\/(?:orgs|users)\/[^/]+\/(?:sources|collections)\/[^/]+\/)HEAD\/$/, '$1') + +// fetchPage(url, page) answers as APIService does in raw mode: a response with +// the page in `data` and the total in the `num_found` header, or the error. A +// page that fails isn't kept, so the next ask reads it again, and a page is +// tried again only while a read still waits for it. +// +// The reader returned, read(url, onList), gives onList the list so far after +// each page, and returns a function that stops it. +export const createMappedSourcesReader = (fetchPage, retry = RETRY) => { + const pages = new Map() + + const readPage = (url, page, waiter) => { + const key = `${versionKey(url)}#${page}` + if(!pages.has(key)) { + const waiting = new Set() + const request = withRetry(() => fetchPage(url, page), {...retry, isCancelled: () => !waiting.size}).then(response => { + if(!Array.isArray(response?.data)) + pages.delete(key) + return response + }) + pages.set(key, {request, waiting}) + } + const {request, waiting} = pages.get(key) + waiting.add(waiter) + return {request: request.finally(() => waiting.delete(waiter)), stop: () => waiting.delete(waiter)} + } + + return (url, onList) => { + const versionUrl = versionURL(url) + const waiter = {} + let stopped = false + let stopWaiting = () => {} + const read = (page, soFar) => { + const {request, stop} = readPage(versionUrl, page, waiter) + stopWaiting = stop + request.then(response => { + if(stopped) + return + const data = Array.isArray(response?.data) ? response.data : [] + const list = [...soFar, ...data] + onList(list) + if(data.length && list.length < parseInt(response?.headers?.num_found || 0)) + read(page + 1, list) + }) + } + read(1, []) + return () => { + stopped = true + stopWaiting() + } + } +} + +// The Bridge Match component mounts once it has the bridge repository's mapped +// sources. A bridge algorithm with no version reads the version its repository +// resolves to in the namespace (resolveVersion answers as APIService does in +// raw mode), and a selected one keeps that version. +// Returns a function that stops the probe. +export const probeBridgeMappedSources = ({algo, selected, namespace, resolveVersion, readMappedSources, pinVersion, onSources, retry = RETRY}) => { + const bridgeUrl = algo?.target_repo_url + if(!algo?.id || !bridgeUrl) + return () => {} + + let stopped = false + let stopReading = () => {} + const read = version => { + stopReading = readMappedSources(bridgeUrl + version + '/', sources => onSources(bridgeUrl, sources)) + } + + if(algo.target_repo_version) + read(algo.target_repo_version) + else + withRetry(() => resolveVersion(bridgeUrl, namespace), {...retry, isCancelled: () => stopped}).then(response => { + const version = response?.data?.[0]?.result?.version + if(stopped || !version) + return + if(selected) + pinVersion(algo.id, version) + read(version) + }) + + return () => { + stopped = true + stopReading() + } +}