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

migrate some legacy events #3246

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

benma
Copy link
Contributor

@benma benma commented Mar 20, 2025

Tagged both @thisconnect and @bznein for frontend and backend, and @bznein especially as maybe it touches on his current work related to removing the synchronizer blocks.

@benma benma requested review from thisconnect, Beerosagos and bznein and removed request for Beerosagos March 20, 2025 14:04
@benma benma force-pushed the syncstarted branch 2 times, most recently from 14ea030 to a307d94 Compare March 21, 2025 11:46
@benma
Copy link
Contributor Author

benma commented Mar 21, 2025

@thisconnect @bznein I continued adding more commits to this PR migrating more events, resulting in a much bigger PR.

Let me know if I should split it into multiple PRs or if it is manageable.

@benma benma force-pushed the syncstarted branch 3 times, most recently from 0e1fbc5 to 4a380c3 Compare March 21, 2025 12:08
@thisconnect
Copy link
Collaborator

Let me know if I should split it into multiple PRs or if it is manageable.

For me it's fine, I'll do only code review for now and when you done adding new commits, test everything in one go.

Copy link
Collaborator

@thisconnect thisconnect left a comment

Choose a reason for hiding this comment

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

very nice 👍

did some frontnend review, untested LGTM (added some questions).

But I'll wait for backend review and will do some testing at the end.

};
};

apiWebsocket(handleMessages);
Copy link
Collaborator

Choose a reason for hiding this comment

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

🎉

@@ -73,12 +74,31 @@ func NewDevice(
log: log,
}
device.Device.SetOnEvent(func(ev firmware.Event, meta interface{}) {
// Old-school
device.fireEvent(event.Event(ev))
Copy link
Collaborator

Choose a reason for hiding this comment

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

is the old-school (event?) here still needed?

Copy link
Contributor Author

@benma benma Mar 21, 2025

Choose a reason for hiding this comment

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

I think so b/c of bitbox01. I might try to remove that later.

Edit: Oh wait this is bitbox02/device.go, not backend.go. Maybe not needed, I'll check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You were right, all the events were converted, so I removed the old-school event here.

@benma benma force-pushed the syncstarted branch 3 times, most recently from 98202bd to ee44b20 Compare March 21, 2025 14:13
benma added 2 commits March 21, 2025 20:18
It is only used for BitBox02. We submit the status in the Object so
the frontend can skip a `getStatus()` call.
Easier structure, to have all bb02 api calls in one
file. E.g. the statusChanged subscription needs `TStatus`.
@benma benma force-pushed the syncstarted branch 2 times, most recently from d7c9011 to 7d55ee2 Compare March 21, 2025 19:22
benma added 2 commits March 21, 2025 21:34
Use status directly as passed, and inline the function.
Was only used in bitbox01.jsx, and there it was actually useless since
DeviceSwitch is fed the devices list already (from app.tsx using the
new style event) to decide to mount/unmount the
component.
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.

None yet

2 participants