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

updating shape of websocket api for at-driver draft spec #31

Merged
merged 11 commits into from
Jan 23, 2024

Conversation

gnarf
Copy link
Contributor

@gnarf gnarf commented Dec 20, 2023

No description provided.

@gnarf gnarf requested review from mzgoddard and jugglinmike and removed request for jugglinmike and mzgoddard December 20, 2023 19:49
test/test.js Outdated
const {whenClosed} = await run([]);
return Promise.race([whenClosed, invert(connect(4382))]);
});
// test('rejects unspecified protocol', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jugglinmike I might be completely missing the relevant point in the spec, but not sure this is a check we need anymore with sub-protocols

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use test.skip?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I chose to comment because we should either re-enable it because something about it should be tested or remove it entirely. Just wasn't sure which without asking

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, @gnarf. Although AT Driver is a ways off from being a standard, I think we're past the point where explicit versioning is helpful. I'll remove these tests.

return {
sessionId: websocket.sessionId,
capabilities: {
atName: 'TODO',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how much we want to do with capabilities here - but the harness does use this information so @mzgoddard will want it to be accurate

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah for atName and atVersion we'll have to detect the running AT software. That will probably be specific to each AT application. Like for atName we can probably scan running processes for certain names. But atVersion will probably then be specific to each AT.

We should be able to do platformName now with os.platform()?

@gnarf
Copy link
Contributor Author

gnarf commented Dec 21, 2023

@mzgoddard @jugglinmike - I think this one is ready to review. I've updated the test suite to test the stuff I added (session.new) and a test path for receiving a voice message from the server. These tests do pass locally.

@gnarf gnarf marked this pull request as ready for review December 21, 2023 15:26
@gnarf gnarf changed the title updating shape of websocket apit for at-driver draft spec updating shape of websocket api for at-driver draft spec Dec 21, 2023
Copy link
Contributor

@mzgoddard mzgoddard left a comment

Choose a reason for hiding this comment

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

I'm not sure I checked everything. After comparing with https://w3c.github.io/at-driver/ this looks good to me.

There are some thing I'd like us to do but I don't think they need to be implemented in this change. (Like separating protocol logic and testing from websocket integration.)

});
};

const onConnection = (websocket) => {
const send = (value) => websocket.send(JSON.stringify(value));
const methodHandlers = {
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

test/test.js Outdated
const {whenClosed} = await run([]);
return Promise.race([whenClosed, invert(connect(4382))]);
});
// test('rejects unspecified protocol', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use test.skip?

@mzgoddard mzgoddard mentioned this pull request Jan 10, 2024
Copy link
Contributor

@jugglinmike jugglinmike left a comment

Choose a reason for hiding this comment

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

Thanks, @gnarf!

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.

3 participants