Sdcisa-20256 typescript hooks - #783
Conversation
* force the user to specify fetch
* the user should not be forced to unsubscribe from each topic, a dispose() shall cover any open topics
* fix message format
* add auto reconnect
* get the build to work "mvn install -pl gateleen-hook-ts -am -DskipTests"
* Awaitility's await().until(supplier, matcher) doesn't retry when the supplier throws, so findElement() calls abort immediately instead of polling until the <li> renders. This pre-existing bug affected both HookJsSteps and HookTsSteps. Add .ignoreExceptions() (and bump timeout to five seconds) so the checks actually retry.
* better angular example readme.md
* add filter
* merged dev into this
* was using internal artefactory possibly due to package-lock.json ...
* extract methods for readability * add prettier * explicitly ignore package-lock.json
* more typing
* improve control flow
* deduplicate
* remove confusing code
* test should not wait real time...
* test should not wait real time...
* merged dev into this
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #783 +/- ##
=============================================
+ Coverage 49.68% 50.33% +0.65%
- Complexity 2047 2094 +47
=============================================
Files 244 244
Lines 12908 13013 +105
Branches 1396 1414 +18
=============================================
+ Hits 6413 6550 +137
+ Misses 5894 5848 -46
- Partials 601 615 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
* the fetch was using / instead of getting the type of fetch from the user. * union type is more usable than enum.
* spelling and invalid tags
* Fix hook parity gaps vs. gateleen-hook-js: send x-expire-after header on registration, correct expireAfter body field, and queue live events during the initial fetch to prevent them racing ahead of it * Deregister a hook on eventbus delivery error instead of silently swallowing it (fail-fast, consistent with registration/fetch error handling) * Extract listen() into PendingEventBuffer, createDispatcher() and createMessageHandler() to keep it readable
There was a problem hiding this comment.
That file looks a bit mis-placed. I assume there is some "totally obvious" reason it is in the hook-js module and not in the hook-ts one?
There was a problem hiding this comment.
2 "Reasons", but I moved it into the hooks-ts as they where not so good anyway.
hooks-js is before hooks-ts, so if they failed the instructions would have been helpful there already.
hooks-ts already has a README.md, so if you don't run the tests manually but let an agent run them then it takes a tiny bit more tokens...
But as if in the future we ever remove the JS part then it makes sense to have it in the TS part anyway...
|
|
||
| service.getEventBus().onopen?.(); | ||
|
|
||
| await Promise.resolve(); |
There was a problem hiding this comment.
await Promise.resolve()
WTF?!? - Should we at least explain (comment) why we do this?
There was a problem hiding this comment.
Thanks! that comment made me find a few flaws in the testing... I added a comment in the code.
Flush the microtask queue (a lighter weight version of await new Promise(r => setTimeout(r, 0)) ).
* move the testing instructions into the ts README.md
* remove global this * remove uneeded examples
* remove copyright
* set the dependency version exactly
* shorten README.md
* make test less magical
* improve the tests
* improve method name
* also use the explicit versions in devDependencies and user newer versions
Create typescript hooks with features equivalent to the hooksjs