Skip to content

feat(Atomic): Make read write the data atomic to avoid corruption of database #449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Aug 1, 2022

Conversation

Belphemur
Copy link
Owner

No description provided.

data = data[property]
} else if (create) {
if (isArray) {
data[property] = []

Check warning

Code scanning / CodeQL

Prototype-polluting assignment

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](1). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](2). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](3). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](4). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](5). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](6). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](7). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](8). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](9). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](10).
if (isArray) {
data[property] = []
} else {
data[property] = {}

Check warning

Code scanning / CodeQL

Prototype-polluting assignment

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](1). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](2). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](3). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](4). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](5). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](6). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](7). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](8). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](9). This assignment may alter Object.prototype if a malicious '__proto__' string is injected from [library input](10).
@codecov
Copy link

codecov bot commented Aug 1, 2022

Codecov Report

Merging #449 (d4a55cf) into develop (edd2944) will decrease coverage by 1.04%.
The diff coverage is 97.99%.

❗ Current head d4a55cf differs from pull request most recent head 5b1f000. Consider uploading reports for the commit 5b1f000 to get more accurate results

@@             Coverage Diff             @@
##           develop     #449      +/-   ##
===========================================
- Coverage   100.00%   98.95%   -1.05%     
===========================================
  Files            6        8       +2     
  Lines          833      859      +26     
  Branches       186      198      +12     
===========================================
+ Hits           833      850      +17     
- Misses           0        8       +8     
- Partials         0        1       +1     
Impacted Files Coverage Δ
src/lib/JsonDBConfig.ts 85.41% <82.05%> (-14.59%) ⬇️
src/adapter/file/AtomicFileAdapter.ts 93.75% <93.75%> (ø)
src/JsonDB.ts 100.00% <100.00%> (ø)
src/adapter/data/JsonAdapter.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.

This was linked to issues Aug 1, 2022
@Belphemur Belphemur merged commit e155804 into develop Aug 1, 2022
@Belphemur Belphemur deleted the file-adapter branch August 1, 2022 22:17
@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2022

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't store a function Atomic Filesystem Writing
1 participant