Skip to content

Commit

Permalink
Merge pull request #707 from nats-io/fix-706
Browse files Browse the repository at this point in the history
[FIX] [JS] [KV] fixed an issue where `maxBucketSize` (deprecated option) overrode `max_bytes`
  • Loading branch information
scottf committed Jun 18, 2024
2 parents 6d63b5c + c507edd commit 8b7c1f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jetstream/kv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function defaultBucketOpts(): Partial<KvOptions> {
replicas: 1,
history: 1,
timeout: 2000,
maxBucketSize: -1,
max_bytes: -1,
maxValueSize: -1,
codec: NoopKvCodecs(),
storage: StorageType.File,
Expand Down
11 changes: 11 additions & 0 deletions jetstream/tests/kv_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2164,3 +2164,14 @@ Deno.test("kv - watcher on server restart", async () => {
await d;
await cleanup(ns, nc);
});

Deno.test("kv - maxBucketSize doesn't override max_bytes", async () => {
let { ns, nc } = await setup(
jetstreamServerConf({}),
);
const js = nc.jetstream();
const kv = await js.views.kv("A", { max_bytes: 100 });
const info = await kv.status();
assertEquals(info.max_bytes, 100);
await cleanup(ns, nc);
});

0 comments on commit 8b7c1f4

Please sign in to comment.