Platform fails to load in browser when switching branches after a new User Profile is added
Context
Operating System: macOS Big Sur 11.6
Software version: today's plugin-docs
Workspace version: Token-Distribution-Superalgos.json
Reproducible: The issue may be reproduced.
Explain your issue
1. Explain what the problem seems to be.
Receiving a file not found error when restarting the app in a different branch after creating a user profile that has not had a pull request approved. It attempts to load the last workspace you were in last, which fails because the user profile is no longer there.
2. Clearly explain what you wish to accomplish.
Run the application.
3. Explain, step by step, what you've done to achieve the goal. The team will follow these steps to reproduce the issue, so be precise.
- Load the
Token-Distribution-Superalgosworkspace. - Create a new user profile that is not in source control.
- Save the workspace.
- Switch the branch through
git checkout [branch]or the commands at the footer of the documentation. I switched from thedevelopmentbranch todocs-pluginusing the footer link in the documentation. - Restart the node application.
- It will now be stuck on
Loading Plugins...step when loading platform in the browser.
4. Explain what is the result you expect from your actions.
Successfully load the application when a branch is changed after creating a user profile that has not been approved by a pull request.
5. Explain what happens instead of the expected results.
Instead of throwing the error in the terminal and failing to load the app, load a system workspace that is always valid. Perhaps throw a warning in the terminal detailing the file was missing.
6. Explain what errors you have found on-screen, on the browser console application, or in the Log-Files folder.
Error in terminal
[WARN] getPluginFileContent -> File not Found -> Path = ./Projects/Governance/Plugins/User-Profiles/jance1499.json
[ERROR] httpInterface -> LoadPlugin -> Method call produced an error.
[ERROR] httpInterface -> LoadPlugin -> err.stack = Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at ServerResponse.setHeader (_http_outgoing.js:558:11)
at respondWithEmptyArray (/Users/jamespannell/Repos/Superalgos/Projects/Foundations/SA/Utilities/HttpResponses.js:107:22)
at Object.respondWithContent (/Users/jamespannell/Repos/Superalgos/Projects/Foundations/SA/Utilities/HttpResponses.js:59:13)
at processRequest (/Users/jamespannell/Repos/Superalgos/Platform/Client/httpInterface.js:1391:81)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
[ERROR] httpInterface -> LoadPlugin -> Params Received = undefined
[ERROR] Platform App -> unhandledRejection -> reason = {"code":"ERR_HTTP_HEADERS_SENT"}
[ERROR] Platform App -> unhandledRejection -> p = {}
Screenshot of browser after error

The current workaround is to switch back to the branch that contains the uncommitted user profile and reload the application and load another workspace before exiting. I did this using git checkout development in the terminal.
Iam having a similar problem. I wanted to contribute my user profile and for that the docs said, i should switch branches and after that restart. But after the restart the application isnt loading and i get similar errors.
please try to do a
git pull upstream
from the console after you switch branches, since your fork might have an outdated version of the develop branch, since this issue was already resolved.
you can switch branches with
git switch develop
Is this issue still valid in latest release?