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

Abstract handling of messages to separate class #23

Merged
merged 6 commits into from
Dec 22, 2023
Merged

Conversation

hickey
Copy link
Owner

@hickey hickey commented Dec 5, 2023

As I was working on #19 in preparation for a release, I was encountering a number of issues in trying to synchronize data and get the data into a steady state.

In building a message class to maintain an internal message DB added the observer pattern to allow the class to notify the front-end code changes in communicate state changes in the DB. This allows the front-end code to be more event driven and a little bit more performant.

With this rewrite, the main code of the front-end (chat.js) has become more structured and simpler to understand the flow. A number of unused and useless variables and some variables have been moved into functions to provide better scoping.

From what I can tell all the same functionality of the old code is still in place. One possible enhancement has been better coordination between the channel selector and the send message channel selector.

The only outstanding issue is that the audio alert is played anytime the channel is changed. This will take a bit more thought on how overcome and will be a patch release in the future.

#19 is blocked on this PR.

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <[email protected]>
Signed-off-by: Gerard Hickey <[email protected]>
Signed-off-by: Gerard Hickey <[email protected]>
@hickey hickey added the enhancement New feature or request label Dec 5, 2023
@hickey hickey added this to the v2.10 milestone Dec 5, 2023
@hickey hickey requested a review from gerner December 5, 2023 20:18
@hickey hickey self-assigned this Dec 5, 2023
@hickey
Copy link
Owner Author

hickey commented Dec 8, 2023

This code is running on http://wt0f-2.local.mesh:8080/meshchat/ for people to test with. @gerner I don't see your nodes on the mesh any longer so I am not sure if you can hit this node or not.

@hickey
Copy link
Owner Author

hickey commented Dec 10, 2023

@gerner I did see the W7AW and W7ACS MeshChat servers last night, you should should still be connected through some of the supernodes. So you should be able to get to the test instance I have running if you want to try anything out.

@hickey
Copy link
Owner Author

hickey commented Dec 22, 2023

I am going to just have to move forward with this PR. I am pretty confident it is good since it has been running on a node for a while and three was a lot of debugging done to replace existing code. If any code improvements are found later on, the code can be refactored at that point.

@hickey hickey merged commit 0d884e4 into master Dec 22, 2023
hickey added a commit that referenced this pull request Jan 3, 2024
* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <[email protected]>

* add more config support

Signed-off-by: Gerard Hickey <[email protected]>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <[email protected]>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <[email protected]>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>
hickey added a commit that referenced this pull request Jan 3, 2024
* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <[email protected]>

* add more config support

Signed-off-by: Gerard Hickey <[email protected]>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <[email protected]>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <[email protected]>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>
hickey added a commit that referenced this pull request Jan 3, 2024
* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <[email protected]>

* add more config support

Signed-off-by: Gerard Hickey <[email protected]>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <[email protected]>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <[email protected]>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>
hickey added a commit that referenced this pull request Jan 3, 2024
* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <[email protected]>

* add more config support

Signed-off-by: Gerard Hickey <[email protected]>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <[email protected]>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <[email protected]>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>
hickey added a commit that referenced this pull request Jan 3, 2024
* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <[email protected]>

* add more config support

Signed-off-by: Gerard Hickey <[email protected]>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <[email protected]>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <[email protected]>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>
hickey added a commit that referenced this pull request Feb 5, 2024
* Update

* Initial pass at reorganization

Reorginanization of the repository so that it is code focused vs. being
focused on how the packages are built. Packaging will be moved to
GitHub Actions so that every commit will create new packages that can
be used for testing. Releases will be created and produce packages
when a tag is committed to the repository.

Signed-off-by: Gerard Hickey <[email protected]>

* Added beginnings of package building code

Signed-off-by: Gerard Hickey <[email protected]>

* Now making directories during package build

Signed-off-by: Gerard Hickey <[email protected]>

* Minor fixes to populate-meshchat-api-fs.sh

Signed-off-by: Gerard Hickey <[email protected]>

* Fixed testing tag for version number

Signed-off-by: Gerard Hickey <[email protected]>

* Updated GitHub workflow

Signed-off-by: Gerard Hickey <[email protected]>

* Fixed incorrect param order for tar in ipk-build.sh

Signed-off-by: Gerard Hickey <[email protected]>

* Storing generated package as an artifact

Signed-off-by: Gerard Hickey <[email protected]>

* Refactored build API workflow

Signed-off-by: Gerard Hickey <[email protected]>

* Added build MeshChat package job

Signed-off-by: Gerard Hickey <[email protected]>

* Removed build file as no longer needed

* Updating version info in meshchatconfig.lua

Signed-off-by: Gerard Hickey <[email protected]>

* More reorganization of files

* Fixed installation of cgi-bin after reorg

Signed-off-by: Gerard Hickey <[email protected]>

* Fixed the installation of web files

Signed-off-by: Gerard Hickey <[email protected]>

* Added branch name and commit ref to testing builds

Signed-off-by: Gerard Hickey <[email protected]>

* Moved MeshChat source to top level

Signed-off-by: Gerard Hickey <[email protected]>

* feat: Set send channel when channel filter changed

Signed-off-by: Gerard Hickey <[email protected]>

* docs: Updated README with history of MeshChat

Signed-off-by: Gerard Hickey <[email protected]>

* chore: Added Bug Report issue template

* chore: Added feature request issue template

* build: Updates to better name packages

Signed-off-by: Gerard Hickey <[email protected]>

* Update Bug Report.yml

* fix: set epoch in send_message API even if not specified

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add message class abstracting message handling (#23)

* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <[email protected]>

* add more config support

Signed-off-by: Gerard Hickey <[email protected]>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <[email protected]>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <[email protected]>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>

* add more fields to bug issue template

Signed-off-by: Gerard Hickey <[email protected]>

* chore: create release CI job

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>
Co-authored-by: Tim Wilkinson <[email protected]>
hickey added a commit that referenced this pull request Feb 5, 2024
* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <[email protected]>

* add more config support

Signed-off-by: Gerard Hickey <[email protected]>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <[email protected]>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <[email protected]>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>
@hickey hickey deleted the message-class branch February 6, 2024 14:55
hickey added a commit that referenced this pull request Feb 18, 2024
* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <[email protected]>

* add more config support

Signed-off-by: Gerard Hickey <[email protected]>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <[email protected]>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <[email protected]>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>
hickey added a commit that referenced this pull request Mar 1, 2024
* fix: fix missing tab for file sharing

* Initial pass at reorganization

Reorginanization of the repository so that it is code focused vs. being
focused on how the packages are built. Packaging will be moved to
GitHub Actions so that every commit will create new packages that can
be used for testing. Releases will be created and produce packages
when a tag is committed to the repository.

Signed-off-by: Gerard Hickey <[email protected]>

* Added beginnings of package building code

Signed-off-by: Gerard Hickey <[email protected]>

* Now making directories during package build

Signed-off-by: Gerard Hickey <[email protected]>

* Minor fixes to populate-meshchat-api-fs.sh

Signed-off-by: Gerard Hickey <[email protected]>

* Fixed testing tag for version number

Signed-off-by: Gerard Hickey <[email protected]>

* Updated GitHub workflow

Signed-off-by: Gerard Hickey <[email protected]>

* Fixed incorrect param order for tar in ipk-build.sh

Signed-off-by: Gerard Hickey <[email protected]>

* Storing generated package as an artifact

Signed-off-by: Gerard Hickey <[email protected]>

* Refactored build API workflow

Signed-off-by: Gerard Hickey <[email protected]>

* Added build MeshChat package job

Signed-off-by: Gerard Hickey <[email protected]>

* Removed build file as no longer needed

* Updating version info in meshchatconfig.lua

Signed-off-by: Gerard Hickey <[email protected]>

* More reorganization of files

* Fixed installation of cgi-bin after reorg

Signed-off-by: Gerard Hickey <[email protected]>

* Fixed the installation of web files

Signed-off-by: Gerard Hickey <[email protected]>

* Added branch name and commit ref to testing builds

Signed-off-by: Gerard Hickey <[email protected]>

* Moved MeshChat source to top level

Signed-off-by: Gerard Hickey <[email protected]>

* feat: Set send channel when channel filter changed

Signed-off-by: Gerard Hickey <[email protected]>

* docs: Updated README with history of MeshChat

Signed-off-by: Gerard Hickey <[email protected]>

* chore: Added Bug Report issue template

* chore: Added feature request issue template

* build: Updates to better name packages

Signed-off-by: Gerard Hickey <[email protected]>

* Update Bug Report.yml

* fix: set epoch in send_message API even if not specified

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add message class abstracting message handling (#23)

* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <[email protected]>

* add more config support

Signed-off-by: Gerard Hickey <[email protected]>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <[email protected]>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <[email protected]>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>

* add more fields to bug issue template

Signed-off-by: Gerard Hickey <[email protected]>

* chore: remove packages from repo

Signed-off-by: Gerard Hickey <[email protected]>

* chore: add release-it config file for automated releases

Signed-off-by: Gerard Hickey <[email protected]>

* fix: discover zone name from /etc/config.mesh (#36)

The zone name has traditionally been discovered by interogating
/etc/config/services. The AREDN firmware is removing this file
in favor of /etc/config.mesh/_setup.services.{dmz|nat}. This
fix updates the location where the zone name is discovered.

Signed-off-by: Gerard Hickey <[email protected]>
Co-authored-by: Tim Wilkinson <[email protected]>

* Add GitHub Actions workflow to automate releases (#40)

* Added beginnings of package building code
* chore: create release CI job
* chore: add documentation section to changelog
* chore: make build-meshchat-package a reusable workflow
* chore: add build packages to release
* fix: update-version.sh can now be told version to set
* chore(ci): convert meshchat-api build to reusable workflow
* chore(ci): set release to only work on release branch

Signed-off-by: Gerard Hickey <[email protected]>

* feat: Add documentation  (#44)

* add API docs as comments
* add luadox configuation
* add parameter table to API calls
* create documentation to be published
* add github pages artifact code
* remove unused README
* make publish-docs workflow reusable for releases
* add troubleshooting documentation

---------

Signed-off-by: Gerard Hickey <[email protected]>

* chore(ci): update release pipeline

Signed-off-by: Gerard Hickey <[email protected]>

* feat: allow admin to set default channel (#19)

A MeshChat administrator now has the ability to define the default
channel that a newly logged in user is placed into. This requires that
the administrator set the value `default_channel` in the configuration
file. Setting `default_channel` to an empty string ('') will continue
using the legacy setting of 'Everything'.

Signed-off-by: Gerard Hickey <[email protected]>

* add LICENSE file

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>
Co-authored-by: Tim Wilkinson <[email protected]>
hickey added a commit that referenced this pull request Mar 2, 2024
* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <[email protected]>

* add more config support

Signed-off-by: Gerard Hickey <[email protected]>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <[email protected]>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <[email protected]>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>
hickey added a commit that referenced this pull request Mar 2, 2024
* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <[email protected]>

* add more config support

Signed-off-by: Gerard Hickey <[email protected]>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <[email protected]>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <[email protected]>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>
hickey added a commit that referenced this pull request Mar 2, 2024
Initial pass at reorganization

Reorginanization of the repository so that it is code focused vs. being
focused on how the packages are built. Packaging will be moved to
GitHub Actions so that every commit will create new packages that can
be used for testing. Releases will be created and produce packages
when a tag is committed to the repository.

Signed-off-by: Gerard Hickey <[email protected]>

Added beginnings of package building code

Signed-off-by: Gerard Hickey <[email protected]>

Updated GitHub workflow

Signed-off-by: Gerard Hickey <[email protected]>

Storing generated package as an artifact

Signed-off-by: Gerard Hickey <[email protected]>

Refactored build API workflow

Signed-off-by: Gerard Hickey <[email protected]>

More reorganization of files

Moved MeshChat source to top level

Signed-off-by: Gerard Hickey <[email protected]>

feat: Set send channel when channel filter changed

Signed-off-by: Gerard Hickey <[email protected]>

docs: Updated README with history of MeshChat

Signed-off-by: Gerard Hickey <[email protected]>

fix: set epoch in send_message API even if not specified

Signed-off-by: Gerard Hickey <[email protected]>

feat: add message class abstracting message handling (#23)

* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <[email protected]>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <[email protected]>

* add more config support

Signed-off-by: Gerard Hickey <[email protected]>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <[email protected]>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <[email protected]>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <[email protected]>

---------

Signed-off-by: Gerard Hickey <[email protected]>

Add GitHub Actions workflow to automate releases (#40)

* Added beginnings of package building code
* chore: create release CI job
* chore: add documentation section to changelog
* chore: make build-meshchat-package a reusable workflow
* chore: add build packages to release
* fix: update-version.sh can now be told version to set
* chore(ci): convert meshchat-api build to reusable workflow
* chore(ci): set release to only work on release branch

Signed-off-by: Gerard Hickey <[email protected]>

chore(ci): update release pipeline

Signed-off-by: Gerard Hickey <[email protected]>

feat: allow admin to set default channel (#19)

A MeshChat administrator now has the ability to define the default
channel that a newly logged in user is placed into. This requires that
the administrator set the value `default_channel` in the configuration
file. Setting `default_channel` to an empty string ('') will continue
using the legacy setting of 'Everything'.

Signed-off-by: Gerard Hickey <[email protected]>
@gerner
Copy link
Collaborator

gerner commented Mar 7, 2024

@hickey I'd like to hear your thoughts about message syncing. I spent a little time thinking about inter-node syncing in the past. You're clearly pretty deep in this, so I'm happy to be a rubber duck for you and hear your plans for improving sync.

I see messaging syncing as one of the most important features and also one that can be fragile. So I'm looking forward to improvements there and willing to help however I can.

@gerner
Copy link
Collaborator

gerner commented Mar 7, 2024

Maybe you can join NWMesh, or we could hop on another zoom call some time?

@hickey
Copy link
Owner Author

hickey commented Mar 7, 2024

Right now my primary focus is moving to getting MeshChat to work in non-node environments (i.e. Linux). This will be the primary focus for the next release so that all the old installations can start to go away and run on currently supported versions. I don't even really consider v2.0 - v2.10 currently supported, but I will try to do what I can to help out getting an installation running. After MeshChat is running on Linux, I will be able to start working on building the testing framework so that regression testing can be done to try to make sure we don't have any errors popping back up.

That is when I will start putting some effort back into the sync process. I have an issue (#17) where I will be keeping track of notes and thoughts on the matter. I welcome anyone to contribute to the issue if they have any good thoughts on how syncing can be improved.

Several months ago (November?) I was on a call with the Seattle guys (you were absent, but several people were wishing you were on the call) and I remember going into groups.io to sign up for the mailing list you have so that I could get on the calls sometimes. I thought that I had received a response saying that I was subscribed, but I don't see anything applicable in my list of subscriptions in groups.io. Maybe someone dropped me or I am thinking of something else? I have just mashed the button to subscribe to the list again. Maybe this time it will stick.

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

Successfully merging this pull request may close these issues.

2 participants