Open Draginfable opened 4 months ago
hi, this productID is indeed not included in the current list. We recently redo some of the produtID and the supported device list should be updated accordingly, is it ok if we extract the code into a package and reference it from this project @maxwellmooney13 ?
Hello @JunzheFan. Thanks for your feedback. The Jabra implementation also takes advantage of the node module that they have provided, so I believe it would be great to directly use the vbet one in the respective implementation. This will also make maintenance easier, as all we will have to do is bump the version up. If you prepare a PR, I will be happy to test it.
@Draginfable hi, I opened a PR for it, can you test if the device you have can function
Hello @JunzheFan, thanks a lot for your work. Indeed I can confirm that VT8200 UNC DUO USB is now working :) Additionally, I have also tested VT X300 BT and it is still working as expected.
However, I see that if I try to build the module, it fails.
npm run install:all
npm run build
This is the error:
> softphone-vendor-headsets@2.5.1 build:src
> tsc -p .
node_modules/@vbet/webhid-sdk/dist/index.d.ts:33:46 - error TS2552: Cannot find name 'HIDDevice'. Did you mean 'IDevice'?
33 declare function createDeviceManager(device: HIDDevice): Promise<IDevice>;
~~~~~~~~~
node_modules/@vbet/webhid-sdk/dist/index.d.ts:41:13 - error TS2552: Cannot find name 'HIDDevice'. Did you mean 'IDevice'?
41 }): Promise<HIDDevice>;
~~~~~~~~~
Found 2 errors in the same file, starting at: node_modules/@vbet/webhid-sdk/dist/index.d.ts:33
On latest develop the build works. Could you please take a look?
Note 1: Build only works with node 16. It fails with node 18 Note 2: The production flag for webpack does not seem to work cc @maxwellmooney13 @jensengar
> softphone-vendor-headsets@2.5.1 build:module
> webpack --mode production
build mode: development
hi @Draginfable thanks for the testing and feedback! The error was due to missing TS definition for the w3c-WebHID APIs, so I changed the package API a bit, now when I run npm run build:src
srcript against node 16 and 18, it was successfully built , can you pull the latest changes and build again
Thanks @JunzheFan!
Indeed the first issue is resolved. However, the build also fails on the last step. To reproduce please either run:
npm run build
or npm run build:module
> softphone-vendor-headsets@2.5.1 build:module
> webpack --mode=production
...
[3] ./node_modules/@vbet/webhid-sdk/dist/index.mjs 6.55 KiB {0} [built] [failed] [1 error]
...
ERROR in ./node_modules/@vbet/webhid-sdk/dist/index.mjs 1:1395
Module parse failed: Unexpected token (1:1395)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
Hi all, I apologize for not being responsive on this. We've been pulled into a number of other things that took our attention. @Draginfable thank you for raising the issue and bringing this to our attention and @JunzheFan thank you for raising a PR to hopefully handle this sorta stuff a lot better.
So the original issue is handled with the PR branch but the issue now is related to builds? I'll take a look today and see if I can make sense of it.
Correct, on master I can build successfully using node 16 (not with 18), but if you checkout this branch the module build fails with both. It could be the same root cause. Please let me know if I can help.
@Draginfable @maxwellmooney13 I got different error on Terser plugin when building, but from the error shown above, it seemed the error was due to webpack is not configured to process mjs extension file, so I updated the package to output only js extension file for ES6, can you guys install again to test if error go away ?
Unfortunately, I still get this error. It could be something on my environment though. I have tried with node v16.20.2 and v18.20.4 on WSL2 Ubuntu 20.04.1 LTS. @maxwellmooney13 Could you also please check if you get an error? Thanks!
@Draginfable can you confirm the error is still the unparsed extension [3] ./node_modules/@vbet/webhid-sdk/dist/index.mjs 6.55 KiB {0} [built] [failed] [1 error] ...
, even though the .mjs extension is switched to index.es.js ? I am on a Windows machine, I did not get this error
[3] ./node_modules/@vbet/webhid-sdk/dist/index.es.js 6.55 KiB {0} [built] [failed] [1 error]
...
ERROR in ./node_modules/@vbet/webhid-sdk/dist/index.es.js 1:1395
Module parse failed: Unexpected token (1:1395)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
softphone-vendor-headsets-develop npm run build:module
softphone-vendor-headsets@2.5.1 build:module webpack --mode production
build mode: development
Hash: 7f5880f098939c8f0ab4
Version: webpack 4.47.0
Time: 3388ms
Built at: 10/08/2024 6:32:10 PM
Asset Size Chunks Chunk Names
1.softhphone-vendor-headsets.js 2.03 KiB 1
1.softhphone-vendor-headsets.js.map 1.84 KiB 1 [dev]
2.softhphone-vendor-headsets.js 19.6 KiB 2
2.softhphone-vendor-headsets.js.map 18.2 KiB 2 [dev]
3.softhphone-vendor-headsets.js 1.71 KiB 3
3.softhphone-vendor-headsets.js.map 1.26 KiB 3 [dev]
softhphone-vendor-headsets.js 600 KiB 0 main
softhphone-vendor-headsets.js.map 713 KiB 0 [dev] main
Entrypoint main = softhphone-vendor-headsets.js softhphone-vendor-headsets.js.map
[1] ./react-app/src/library/types/consumed-headset-events.ts 757 bytes {0} [built]
[2] ./react-app/src/library/services/vendor-implementations/vendor-implementation.ts 10.4 KiB {0} [built]
[3] ./react-app/node_modules/browserama/out/browserama.min.js 972 bytes {0} [built]
[4] ./node_modules/events/events.js 14.5 KiB {0} [built]
[6] ./react-app/src/library/types/call-info.ts 0 bytes {0} [built]
[7] ./react-app/src/library/types/device-info.ts 0 bytes {0} [built]
[8] ./react-app/src/library/types/emitted-headset-events.ts 10 bytes {0} [built]
[9] ./react-app/src/library/types/headset-states.ts 0 bytes {0} [built]
[10] ./react-app/node_modules/fetch-jsonp/build/fetch-jsonp.js 3.78 KiB {0} [built]
[11] ./react-app/src/library/services/headset.ts + 61 modules 379 KiB {0} [built]
| ./react-app/src/library/services/headset.ts 38.7 KiB [built]
| ./react-app/src/library/services/vendor-implementations/CyberAcoustics/CyberAcoustics.ts 50.8 KiB [built]
| ./react-app/src/library/services/vendor-implementations/plantronics/plantronics.ts 43.8 KiB [built]
| ./react-app/src/library/services/vendor-implementations/sennheiser/sennheiser.ts 15.2 KiB [built]
| ./react-app/src/library/services/vendor-implementations/jabra/jabra.ts 45.1 KiB [built]
| ./react-app/src/library/services/vendor-implementations/jabra/jabra-native/jabra-native.ts 29.3 KiB [built]
| ./react-app/src/library/services/vendor-implementations/yealink/yealink.ts 34.6 KiB [built]
| ./react-app/src/library/services/vendor-implementations/vbet/vbet.ts 43.8 KiB [built]
| ./node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js 541 bytes [built]
| ./node_modules/rxjs/dist/esm5/internal/Subscription.js 5.54 KiB [built]
| ./node_modules/rxjs/dist/esm5/internal/config.js 231 bytes [built]
| ./node_modules/rxjs/dist/esm5/internal/util/noop.js 59 bytes [built]
| ./node_modules/rxjs/dist/esm5/internal/Subscriber.js 5.89 KiB [built]
| ./node_modules/rxjs/dist/esm5/internal/symbol/observable.js 161 bytes [built]
| ./node_modules/rxjs/dist/esm5/internal/util/identity.js 82 bytes [built]
| + 47 hidden modules
[12] ./react-app/src/library/index.ts 417 bytes {0} [built]
[13] ./node_modules/rxjs/dist/esm5/index.js 9.88 KiB [built]
[22] ./node_modules/rxjs/dist/esm5/operators/index.js 6.71 KiB [built]
[23] ./node_modules/rxjs/dist/esm5/internal/AsyncSubject.js 1.45 KiB [built]
[24] ./node_modules/rxjs/dist/esm5/internal/BehaviorSubject.js 1.23 KiB [built]
ERROR in softhphone-vendor-headsets.js from Terser
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/terser-webpack-plugin/dist/index.js:217:37
at Array.forEach (
ERROR in 1.softhphone-vendor-headsets.js from Terser
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/terser-webpack-plugin/dist/index.js:217:37
at Array.forEach (
ERROR in 2.softhphone-vendor-headsets.js from Terser
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/terser-webpack-plugin/dist/index.js:217:37
at Array.forEach (
ERROR in 3.softhphone-vendor-headsets.js from Terser
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/terser-webpack-plugin/dist/index.js:217:37
at Array.forEach (
On develop I get an error with node 18. But it works with node 16.
@Draginfable @maxwellmooney13 hello, I found out the issue was because the vbet package was not transpile to es5 because the plugin it used does not support producing es5 https://github.com/egoist/rollup-plugin-esbuild/issues/364, so I use the webpack babel loader in your project to transpile instead by changing the webpack config this line to /* if we are building for 'module', don't polyfill, transpile, or bundle any dependencies – except stanza because it has node deps... */ babelExcludes = [/node_modules\/(?!(core\-util\-is|@vbet[\\/]webhid-sdk)).*/];
. the error went away, but am I not sure if it's ok to do so
Hi all! Once again, I'm sorry for a lack of response here... I've had a lot of things come up that required attention. Great job finding a solution for the build issue! I'll look at the changes and double check to make sure it's okay.
Pulling down the branch now to check
Hey all, you guys probably already figured this out yourselves but with the branch locally, just making the change @JunzheFan suggested in the webpack config was not enough (however that change does fix the error mentioned regarding an appropriate loader being needed). I still had a bunch of Tenser related errors which were fixed by running npm update
in both the root folder and react-app
. So with those changes, the builds worked as expected though I still need to check how things work now if these updates had unexpected effects in regards to functionality. I'll be checking that in a little bit but wanted to put it out there for the time being. I'll also still do some digging for the "appropriate loader" error that has been discussed above to see if this is the best course of action and if that has any unexpected effects. Thank you both for your work and discussions on this and I apologize it took me so long to really dive into this
@JunzheFan is the @vbet/webhid-sdk
dependency already transpiled? I was looking for a solution on my own but nothing came of my research. I spoke with Garrett and he said that sometimes transpiling something twice could cause issues. Which would explain why your change to the babelExcludes
part of the webpack.config.js
is fixing the issue because then it is only transpiled once which is the original time it was transpiled. Hopefully that makes sense!
@maxwellmooney13 hello, yes indeed the package itself is not transpiled(i.e. no babel tools is configured) the output bundled code stay at modern es2015/es6 format which is not applicable to very old browswer, thus I need to resort to the webpack babel loader in this project to do the transpileing work, or I have to find another way to pre-transpiled the code to fit within the softphone-vendor-headsets project so that in this case the babelExcludes
configuration is not needed
Hi @JunzheFan I made a change that seems to work locally. In the webpack.config.js
, in the module: {...}
section, we currently have:
module: {
rules: [
{
test: /\.(cjs|mjs|js|ts)$/,
loader: 'babel-loader',
exclude: babelExcludes,
options: babelOptions
}
]
}
but adding in
module: {
rules: [
{
test: /\.(cjs|mjs|js|ts)$/,
loader: 'babel-loader',
exclude: babelExcludes,
options: babelOptions
},
{
test: /\.es.js$/,
include: [
path.resolve(__dirname, 'node_modules/@vbet/webhid-sdk'),
],
use: {
loader: 'babel-loader'
}
}
]
}
I'm not sure if there is a better way to make this cleaner but this seems to work, at the very least it builds properly for me but I'll need to try with the demo app and such to see that we are in fact all good.
@maxwellmooney13 hi, at the end of the day it comes to transpile the code down via babel, I have made a new version where babel is configured within the package itself so that webpack.config.js modification is not needed, can you pull down new package version and give it a try
@JunzheFan I still had to run npm update
for both the root directory and react-app
to fix the Terser errors but I did notice that there was no issue around the loaders anymore. After running npm update
, everything built totally fine! I'll need to make some time to check the demo app and such but so far looks good! Great job on this 👍 . So the most recent change is within the @vbet/webhid-sdk dependency right?
@Draginfable when you get a chance, I would like your opinion on the latest change too (more from a functionality standpoint)
@maxwellmooney13 yes recent changes is all within the package, regarding the testing, I noticed something strange in the demo app that when you init a Incomming call, the end All calls
, end current call
as well as thereject
button will light up after that, but I suppose the reject button in this case is used to reject the incomming call from the UI, not sure the purpose of other two buttons, when I clicked those two buttons only the end All calls
callback will be called but not for the end current call
, so it failed to "end" the current incomming call, thereby the LED on the device will keep flashing
Great job guys! Thanks a lot! I have just tested with the test app with both of my devices, and they both work perfectly, I will also test in my app and let you know. Btw @JunzheFan, please also commit the package-lock.json.
EDIT: @maxwellmooney13 I have just tested with my app as well. Both headsets work as expected. So from my side the PR is good to go as soon as @JunzheFan also commits the package-lock.json
hi guys I have updated package-lock.json to the newest package version
@maxwellmooney13 hi, the management is asking the estimated time the changes can get released to production ,do you have any idea, thanks
@JunzheFan just merged your changes in. I'll need to make some time to go through the proper steps to get this into production but at this moment, your part in the change is done! I'll work on getting it to prod this week.
Is this issue good to close now?
Great news. Looking forward to the release!
Hi all, just as a heads up, I'm trying to get the changes in for a release but we are having some branching issues with the repo. We'll be able to get the changes out as soon as we fix these.
@maxwellmooney13 hey max, is this released or waiting for the pending PR you made ?
Hi @JunzheFan I was bouncing between a few different things and got sidetracked from the PR. I'm going to merge my unit test PR to (hopefully) ensure proper builds of the release branch. I will do that tomorrow (tomorrow for me, later today for you!) and quickly get the release up and running.
@maxwellmooney13 morning,can you inform us when the release is done ,we wanted to do a few testing today found that the changes might not have been applied ,also do you know what's required for the devices to function on the desktop version app
hi @JunzheFan ! at the earliest, i can get it out this weekend but i will keep you up to date. i will work on this today. as for the desktop app, we are currnetly unable to use WebHID functionality on the desktop app. we are actively looking for a proper solution though this may take a lot more effort.
@JunzheFan Actively working on getting this out. Facing some blockers on our end that are making our process a bit more difficult but wanted you to know I am still working on this.
Hi all, I think we finally got things sorted out and good! The way our release schedule works, I think we should get this out this weekend I believe. I will keep everyone updated if something changes. As always, I apologize for this whole process taking way longer than it should have but we are in sight of the finish line now! Thank you for the work on this and the testing provided for the change.
Just out of curiosity, I tested with v2.5.4 and the vbet headsets seem to work fine. Is something important missing from this release, or is it ok if we use this one until the final one is released?
@Draginfable @maxwellmooney13 hi guys, I assume the release is done as our people tested it yesterday and headsets were working correctly, @Draginfable what is the problem you have here can you instruct how to reproduce it, is the problem related to the mute functionality, the testing staff once encounted a case where muting from the PC end was not propogating to the headset, but when testing again, the problem went away, so it's strange could be the networking issue
@JunzheFan I dont have any issues with version 2.5.4 However, @maxwellmooney13 mentioned that we should expect a release this weekend. That's why I'm asking him if something is missing. If not, I will be happy to close this issue. Once again, thank you for your work.
@Draginfable @JunzheFan hey guys! I'm really sorry, I wasn't getting notifications for this for some time and I don't know why. I'm also sorry for not providing updates... So when I checked earlier today we were in the process of releasing but I haven't confirmed since. I imagine if there are no issues though, it must have released. I'll confirm tomorrow though
@Draginfable I am a bit lost here, the current package version seems to be 2.5.5, is the issuse you mentioned is a device issuse or CI/CD release issue , i am not sure how these versions map to the actual release, we tested on the following genesys version where the devices were working fine
It's not really an issue necessarily. I think it's just a scheduling thing our end. I checked a little bit ago and it appears that it did get released to a few production regions but possibly not all.
But I'm now realizing... are you asking about the release of Genesys Cloud, it looks like or did you just want to know when the SDK released to use for dev purposes?
But looking at our releases, I'm also confused because the timeline lines up in some places but in others it suggests that the deployment is not yet completed. What region are you if you don't mind me asking?
@maxwellmooney13 Let me clarify. I am talking about the node module. I see that the version 2.5.4 was released 15 days ago, and I tested it on my app successfully. However, you mentioned that the release process is delayed, so I am not sure if we should use 2.5.4 or wait for another npm release. Btw I'm located in Greece, but that should not affect an npm release I think.
On a separate note, I believe that indeed @JunzheFan is talking about Genesys Cloud.
ok I see, the upstream npm package is ineed one version behind the current one, I assume the Genesys Clound we were testing on was dependant on the 2.5.5 ? perhaps @maxwellmooney13 just need to release the 2.5.5 to npm registry
Version 2.5.4 will have the changes you are expecting and that appears to be the one on NPM
Great, so as far as I'm concerned this issue is resolved. Thanks again!
Device: VT8200 UNC DUO USB P/N: 8257-91-00UK Product Id: 0x0028
This product id is not included in the masks / deviceCmds and none of these four masks seem to work.
cc @maxwellmooney13 @jensengar Please let me know if I need to provide more information.