[PR #265] [MERGED] Split code into multiple files for easier maintenance #197

Closed
opened 2026-05-23 08:33:05 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/appy-one/acebase/pull/265
Author: @appy-one
Created: 10/10/2025
Status: Merged
Merged: 5/18/2026
Merged by: @appy-one

Base: masterHead: quality/organize-code


📝 Commits (10+)

  • e7b6203 Split code into multiple files for easier maintenance
  • e788c54 Fix: make sure unallocated records are not referenced in cache anymore. Might prevent CorruptRecordErrors from occuring whilst running in a single process.
  • cd10f2c Fix failing node address lookups never resolving a parent read/write operation
  • fbe619c Add node info to readHeader error message
  • a5cc57c Fix: suppress unhandled promise rejections and PromiseRejectionHandledWarning
  • c41bb02 Enhance node read/write error handling, automatically await child stream callback promises, fix locks potentially not being released upon error, reduce mem/cpu usage when reading/writing large nodes (maybe also slowing down a bit but not noticeably when running the tests), improve logging
  • dc17370 (commented out) add a way to test with very short lock timeouts
  • 3611f5c Improve node-lock test to handle lock timeouts correctly
  • 3397a04 Fix transaction log tests that did not always get the most recent cursor because of a race condition
  • 3d64340 Add corrupted node testing capability. Writing to path simulate/corrupt/record/here will now simulate a corrupted record

📊 Changes

37 files changed (+7378 additions, -7200 deletions)

View changed files

📝 dist/browser.js (+159 -140)
📝 dist/browser.min.js (+1 -1)
📝 package-lock.json (+2 -2)
📝 package.json (+1 -1)
📝 src/api-local.ts (+4 -4)
📝 src/btree/binary-tree.ts (+13 -5)
src/storage/binary/binary-storage-address-range.ts (+3 -0)
src/storage/binary/binary-storage-settings.ts (+74 -0)
src/storage/binary/binary-storage.ts (+2323 -0)
src/storage/binary/flags.ts (+9 -0)
📝 src/storage/binary/index.ts (+2 -4629)
src/storage/binary/internal-node-reference.ts (+20 -0)
src/storage/binary/node-allocation.ts (+127 -0)
src/storage/binary/node-reader.ts (+1069 -0)
src/storage/binary/node-writer/create-node.ts (+28 -0)
src/storage/binary/node-writer/get-value-bytes.ts (+6 -0)
src/storage/binary/node-writer/lock-and-write-node.ts (+14 -0)
src/storage/binary/node-writer/merge-node.ts (+379 -0)
src/storage/binary/node-writer/rebuild-key-tree.ts (+47 -0)
src/storage/binary/node-writer/serialize-value.ts (+127 -0)

...and 17 more files

📄 Description

This splits up the code into multiple files for easier maintenance, also includes latest fixes to increase stability, performance and prevent data curruption.

The code in this branch has been battle-tested for a week on a fairly busy app backend database with extremely satisfying results


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/appy-one/acebase/pull/265 **Author:** [@appy-one](https://github.com/appy-one) **Created:** 10/10/2025 **Status:** ✅ Merged **Merged:** 5/18/2026 **Merged by:** [@appy-one](https://github.com/appy-one) **Base:** `master` ← **Head:** `quality/organize-code` --- ### 📝 Commits (10+) - [`e7b6203`](https://github.com/appy-one/acebase/commit/e7b6203da2ce45edd82b734352f77a5dcd5bc350) Split code into multiple files for easier maintenance - [`e788c54`](https://github.com/appy-one/acebase/commit/e788c543301e439602a8f437002d25feb57370ef) Fix: make sure unallocated records are not referenced in cache anymore. Might prevent `CorruptRecordError`s from occuring whilst running in a single process. - [`cd10f2c`](https://github.com/appy-one/acebase/commit/cd10f2cea674585647d12d4fdc91a0c0431f341b) Fix failing node address lookups never resolving a parent read/write operation - [`fbe619c`](https://github.com/appy-one/acebase/commit/fbe619c23514ee658cb8929539fa89ab514cf90e) Add node info to `readHeader` error message - [`a5cc57c`](https://github.com/appy-one/acebase/commit/a5cc57ce6afa06d1163b87f42d436259b9dd45d8) Fix: suppress unhandled promise rejections and PromiseRejectionHandledWarning - [`c41bb02`](https://github.com/appy-one/acebase/commit/c41bb02cad27a7329b5114455c2fd9d7bd2333c5) Enhance node read/write error handling, automatically await child stream callback promises, fix locks potentially not being released upon error, reduce mem/cpu usage when reading/writing large nodes (maybe also slowing down a bit but not noticeably when running the tests), improve logging - [`dc17370`](https://github.com/appy-one/acebase/commit/dc173709b499d1860d8e37da05059c644ab273d6) (commented out) add a way to test with very short lock timeouts - [`3611f5c`](https://github.com/appy-one/acebase/commit/3611f5c76ce8a6c4d0c669dc88d0a764ab26d811) Improve node-lock test to handle lock timeouts correctly - [`3397a04`](https://github.com/appy-one/acebase/commit/3397a04cc2f135a83a948a579587a571eb3164e3) Fix transaction log tests that did not always get the most recent cursor because of a race condition - [`3d64340`](https://github.com/appy-one/acebase/commit/3d64340c7a3010dc4609a32e790ce37605a9eecb) Add corrupted node testing capability. Writing to path `simulate/corrupt/record/here` will now simulate a corrupted record ### 📊 Changes **37 files changed** (+7378 additions, -7200 deletions) <details> <summary>View changed files</summary> 📝 `dist/browser.js` (+159 -140) 📝 `dist/browser.min.js` (+1 -1) 📝 `package-lock.json` (+2 -2) 📝 `package.json` (+1 -1) 📝 `src/api-local.ts` (+4 -4) 📝 `src/btree/binary-tree.ts` (+13 -5) ➕ `src/storage/binary/binary-storage-address-range.ts` (+3 -0) ➕ `src/storage/binary/binary-storage-settings.ts` (+74 -0) ➕ `src/storage/binary/binary-storage.ts` (+2323 -0) ➕ `src/storage/binary/flags.ts` (+9 -0) 📝 `src/storage/binary/index.ts` (+2 -4629) ➕ `src/storage/binary/internal-node-reference.ts` (+20 -0) ➕ `src/storage/binary/node-allocation.ts` (+127 -0) ➕ `src/storage/binary/node-reader.ts` (+1069 -0) ➕ `src/storage/binary/node-writer/create-node.ts` (+28 -0) ➕ `src/storage/binary/node-writer/get-value-bytes.ts` (+6 -0) ➕ `src/storage/binary/node-writer/lock-and-write-node.ts` (+14 -0) ➕ `src/storage/binary/node-writer/merge-node.ts` (+379 -0) ➕ `src/storage/binary/node-writer/rebuild-key-tree.ts` (+47 -0) ➕ `src/storage/binary/node-writer/serialize-value.ts` (+127 -0) _...and 17 more files_ </details> ### 📄 Description This splits up the code into multiple files for easier maintenance, also includes latest fixes to increase stability, performance and prevent data curruption. The code in this branch has been battle-tested for a week on a fairly busy app backend database with extremely satisfying results --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-23 08:33:05 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/acebase#197
No description provided.