dsh-memu-memory 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,7 @@ const React = {
25
25
  if (hooks[index] === undefined) hooks[index] = typeof initial === "function" ? initial() : initial
26
26
  return [hooks[index], (next) => { hooks[index] = typeof next === "function" ? next(hooks[index]) : next }]
27
27
  },
28
+ memo: (component) => component,
28
29
  useCallback: (fn) => fn,
29
30
  useMemo: (fn) => fn(),
30
31
  useEffect(fn, deps) { effects.push({ fn, deps }) },
@@ -25,6 +25,7 @@ const React = {
25
25
  if (hooks[index] === undefined) hooks[index] = typeof initial === "function" ? initial() : initial
26
26
  return [hooks[index], (next) => { hooks[index] = typeof next === "function" ? next(hooks[index]) : next }]
27
27
  },
28
+ memo: (component) => component,
28
29
  useCallback: (fn) => fn,
29
30
  useMemo: (fn) => fn(),
30
31
  useEffect(fn, deps) { effects.push({ fn, deps }) },
@@ -200,6 +200,12 @@ test('single-library browseWall still carries global rows and F1/F2 metadata', a
200
200
 
201
201
  const wall = await dispatch({}, 'browseWall', { libraryId: library.id })
202
202
  assert.ok(wall.items.some((item) => item.id === 'mem-private-merge'), 'the authorized private row is present')
203
+ // 记忆墙按 offset 逐批读完整库:分页不得改变 total,也不得重排(新到旧)。
204
+ const wallPage = await dispatch({}, 'browseWall', { libraryId: library.id, limit: 1, offset: 1 })
205
+ assert.equal(wallPage.offset, 1)
206
+ assert.equal(wallPage.total, wall.total, 'paging must not change the total')
207
+ assert.equal(wallPage.items.length, 1)
208
+ assert.equal(wallPage.items[0].id, wall.items[1].id, 'offset continues the same sorted list')
203
209
  const globalRow = wall.items.find((item) => item.id === 'gmem-linked')
204
210
  assert.ok(globalRow, 'a single-library wall must keep the shared global scope')
205
211
  assert.equal(globalRow.libraryId, null)
@@ -214,7 +220,8 @@ test('single-library browseWall still carries global rows and F1/F2 metadata', a
214
220
 
215
221
  const source = fs.readFileSync(new URL('../lib/client.js', import.meta.url), 'utf8')
216
222
  assert.match(source, /wallAllBlocked/, 'the single-library fallback explains itself')
217
- assert.match(source, /browseWall', \{ libraryId: firstLibraryId/, 'the wall retries the first library after an all-libraries 403')
223
+ assert.match(source, /const stream = async \(targetLibraryId\)/, 'the wall reads the library in batches')
224
+ assert.match(source, /await stream\(firstLibraryId\)/, 'the wall retries the first library after an all-libraries 403')
218
225
  assert.match(source, /setMultiBlocked\(true\)/, 'the fallback disables the all-libraries option')
219
226
  })
220
227
  test('the settings button preserves the host SPA and links to individual pages', () => {