Skip to content

Implement auto-recover functionality [B: 1403]#483

Merged
abeverley merged 36 commits intoctrlo:devfrom
droberts-ctrlo:autosave-reset
Jan 20, 2025
Merged

Implement auto-recover functionality [B: 1403]#483
abeverley merged 36 commits intoctrlo:devfrom
droberts-ctrlo:autosave-reset

Conversation

@droberts-ctrlo
Copy link
Contributor

No description provided.

@droberts-ctrlo droberts-ctrlo changed the title Reset and rerun of commit Reset and rerun of commit [B: 1403] Dec 2, 2024
@droberts-ctrlo droberts-ctrlo marked this pull request as draft December 2, 2024 14:53
@droberts-ctrlo droberts-ctrlo marked this pull request as ready for review December 16, 2024 10:36
@abeverley abeverley changed the title Reset and rerun of commit [B: 1403] Implement auto-recover functionality [B: 1403] Dec 19, 2024
Copy link
Contributor

@abeverley abeverley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work Dave, this is looking really good. I've made a few minor comments so far. I'd also like to test it in practice, but I'm getting Uncaught (in promise) TypeError: crypto.subtle is undefined - any ideas?

Also moved ID for current record out of Curval condition
- Added checks to ensure encryption is available for Autorecover
- Improved encrypted storage testing
- Added NullStorage to disable storage without having to search through all code
- Added tests for NullStorage, AppStorage, and GADSStorage classes
- Updated test definitions to allow for crypto testing

As noted above the modal and field components will not have recovery enabled should encryption be unavailable within storage; this is in order to meet standards for ISO:27001 (DARE is mandatory) - the `setValue` function in the `curval` component should never be called when this is the case, but in case it is, the Null Receiver pattern is used (hence the `NullStorage`, which is a full no-op storage solution for our use case).
* @param {JQuery<HTMLElement> | HTMLElement} el The element to attach the document component to
*/
export default function documentComponent(el: JQuery<HTMLElement> | HTMLElement) {
Promise.all([(new DocumentComponent(el)).init()]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually need a component to be returned here now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All that's changed here is the change to check for jQuery being defined so all the tests pass as expected

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Abstract factory to create the relevant storage provider

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are skipped on Node 18

Said behaviour was only placed in for previous requirement that has since been removed
It was found that due to the curval recovery working on events, it was sometimes triggering a write when one isn't required.
Test condition was returning true in unit tests meaning tests failed.
Copy link
Contributor

@abeverley abeverley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Dave, almost there!!

@abeverley abeverley merged commit e7ed08e into ctrlo:dev Jan 20, 2025
7 checks passed
@droberts-ctrlo droberts-ctrlo deleted the autosave-reset branch January 21, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants