This repository was archived by the owner on Apr 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
This repository was archived by the owner on Apr 13, 2025. It is now read-only.
Use of error in nodecg-io-core where warning is appropriate #365
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestframeworkRequires changes to the frameworkRequires changes to the frameworkminorQuick to implementQuick to implement
Milestone
Description
Description
nodecg-io-core logs out an error when config is already deencrypted.
Fix change the log if it is a config already decrypted error from error to warning
How to reproduce
- Add to
cfg/nodecg-io-core.jsonthe config to auto login like described in the documentation. - Open
localhost:9090, login and restart nodecg - Now the browser is faster to decrypt the config before
nodecg-io-corecan auto login,
therefore nodecg-io-core is logging an error.
error: [nodecg-io-core] Failed to automatically login: Config has already been decrypted and loaded.
References
nodecg-io/nodecg-io-core/extension/persistenceManager.ts
Lines 283 to 307 in 58b695a
| private setupAutomaticLogin(password: string): void { | |
| // We need to do the login after all bundles have been loaded because when loading these might add bundle dependencies | |
| // or even register services which we need to load nodecg-io. | |
| // There is no official way to wait for nodecg to be done loading so we use more or less a hack to find that out: | |
| // When we declare the replicant here we will trigger a change event with a empty array. | |
| // Once nodecg is done loading all bundles it'll assign a array of bundles that were loaded to this replicant | |
| // So if we want to wait for nodecg to be loaded we can watch for changes on this replicant and | |
| // if we get a non-empty array it means that nodecg has finished loading. | |
| this.nodecg.Replicant<unknown[]>("bundles", "nodecg").on("change", async (bundles) => { | |
| if (bundles.length > 0) { | |
| try { | |
| this.nodecg.log.info("Attempting to automatically login..."); | |
| const loadResult = await this.load(password); | |
| if (!loadResult.failed) { | |
| this.nodecg.log.info("Automatic login successful."); | |
| } else { | |
| throw loadResult.errorMessage; | |
| } | |
| } catch (err) { | |
| this.nodecg.log.error(`Failed to automatically login: ${err}`); | |
| } | |
| } | |
| }); | |
| } |
hlxid
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestframeworkRequires changes to the frameworkRequires changes to the frameworkminorQuick to implementQuick to implement