Skip to content
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

refactor GRaaS web app #297

Open
owades opened this issue May 20, 2022 · 2 comments
Open

refactor GRaaS web app #297

owades opened this issue May 20, 2022 · 2 comments
Labels
high priority Important issue

Comments

@owades
Copy link
Member

owades commented May 20, 2022

The current position updates web app relies on a long series of callbacks, which should be refactored to use async/await. This is major tech debt, and is important to fix for the sake of future programmers' sanity.

@owades owades changed the title replace callbacks in web app with async/await refactor GRaaS web app Jul 5, 2022
@owades owades added the high priority Important issue label Jul 5, 2022
@unreasonableman
Copy link
Collaborator

Another important aspect of a refactor is to add something like a plugin architecture to graas.js. Over time, all kinds of features, flavors and test code has been added to the module, and it's become convoluted. The latest example of this undesirable effect has been the addition of a trip inference test harness (perpetrated by, uh, me).

Plugin scripts could be loaded dynamically, along the lines of this SO answer.

This is a significant change that would likely take between 3 and 5 days, but the resulting separation of often unrelated functionality and the benefits to future additions to the module seem worthwhile.

Alternatively, functionality common between items such as plain old graas client with manual driver interaction, autonomous graas client with trip inference or block assignment, trip inference test harness, etc. could be factored out into something like a graas-common.js module, and then very thin actual clients would be implemented on top of that.

Potential functionality for graas-common.js:

  • loading and handling of config data
  • signing and sending of messages, in particular the frequently sent GPS updates
  • wake lock handling
  • handling authentication data: entering as QR code or naked PEM data, putting into and retrieving from local storage
  • some UI utility code

Upon some thought, the latter approach (creation of graas-common.js and factoring out of different clients) seems cleaner and more versatile than the plugin approach.

@owades
Copy link
Member Author

owades commented Oct 13, 2022

@unreasonableman I appreciate this stream-of-consciousness update! graas-common.js sounds like a huge relief

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

No branches or pull requests

2 participants