adobe / aio-lib-events Goto Github PK
View Code? Open in Web Editor NEWAdobe I/O Javascript SDK library for Adobe I/O Events APIs
Home Page: https://www.adobe.io
License: Apache License 2.0
Adobe I/O Javascript SDK library for Adobe I/O Events APIs
Home Page: https://www.adobe.io
License: Apache License 2.0
See links to https://rxjs.dev/
See https://rxjs-dev.firebaseapp.com instead
See errors reported here - https://github.com/adobe/aio-e2e-tests/actions/runs/594925640
README of the project includes an example for "Using the poller for journalling", which suggests invocation of .unsubscribe
on object returned by RxJS' Observable.subscribe
's returned by EventsCoreAPI.getEventsObservableFromJournal
.
journalling.unsubscribe
should stop the stream of events being emitted after the timeout expires.
setTimeout(() => this.subscription.unsubscribe(), 1000)
^
TypeError: Cannot read property 'unsubscribe' of undefined
at Timeout._onTimeout (/Users/ashishc/repo/aio-journal-consumer/journalConsumer.js:20:38)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
Execution of the sample-code for project README is sufficient to demonstrate the issue.
"Using the poller for journalling" sample-code from README, set a valid timeout and wait for that duration to pass after invocation of the code.
macOS 10.15.4
node v13.13.0
npm v6.16.4
"Using the poller for journalling" sample-code from README
N/A
Function signatureUtils::fetchPublicKeyFromCloudFront:
aio-lib-events/src/signatureUtils.js
Lines 147 to 167 in bfb5e17
This is an odd use of both async/await and Promise.then, it works - but can be confusing for devs not used to it.
The then() clause assigns to a variable pubKey, which works in this case because of the await (if not pubKey would always be undefined), but it could just simply be the return value for the then(), and should therefore end up to be the return value of the await.
But the problematic item is the catch() clause. It returns helpers.exportFunctions.genErrorResponse(500, error.message)
, which has two problems:
helpers.exportFunctions.genErrorResponse
returns an object, and this function explicitly says it should return a string in the jsdoc. This is a mismatch.This therefore renders the test "Test Fetch Key from CloudFront with Invalid Pub Key Url -> verify for invalid pub key" in signatureUtils.test.js as an invalid test since it will never throw an error. In fact the test is bogus (it passes but it is made to pass) - it doesn't really test the (mocked) return value - it tests an error that it sets up itself.
The test is here:
aio-lib-events/test/signatureUtils.test.js
Lines 73 to 90 in bfb5e17
π¨ Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! π ππ¨ π
Find out how to migrate to Snyk at greenkeeper.io
25.2.0
to 25.2.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-jsdoc is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 3 commits.
d330391
fix(check-param-names, require-param): check ExperimentalRestProperty
from babel-eslint
as with RestElement
; fixes #536
aaae00e
test(require-jsdoc): show exclusion of constructor
87c6384
chore: bump regextras version
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Search for the text:
eslint-disable-next-line jest/no-conditional-expect
The disabling of these lines were temporary due to the eslint config upgrade. Using conditional expects do hide certain implementation issues or bad/incomplete tests.
Function signatureUtils::fetchPemEncodedPublicKeys :
aio-lib-events/src/signatureUtils.js
Lines 50 to 68 in bfb5e17
The problematic item is the catch() clause. It returns helpers.exportFunctions.genErrorResponse(500, 'Error occurred while fetching pem encoded Public Key')
, which has a problem:
helpers.exportFunctions.genErrorResponse
returns an object, and this function explicitly says it should return an Array of (two) strings (tuple).This therefore renders the test "Test Fetch Pem Encoded Public Keys -> verify for invalid pub key url throws" in signatureUtils.test.js as an invalid test since it will never throw an error. In fact the test is bogus - it doesn't really test the (mocked) return value - it tests an error that it sets up itself.
The test is here:
aio-lib-events/test/signatureUtils.test.js
Lines 91 to 108 in bfb5e17
This is to communicate an upcoming major version change to @adobe/aio-lib-core-networking
to 2.0.0
.
Your @adobe/aio-lib-core-networking
version is ^1.0.0
and will not be affected by an npm install
unless you manually change it to ^2.0.0
PR for discussion: adobe/aio-lib-core-networking#14
The major change to take note if you upgrade, is the export of the library.
In 1.x.x
the export of @adobe/aio-lib-core-networking
returns an instance of the HttpExponentialBackoff
class.
In 2.x.x
the export of @adobe/aio-lib-core-networking
returns an object, which contains the HttpExponentialBackoff
class (which you need to instantiate).
1.x.x
:
const fetchRetry = require('@adobe/aio-lib-core-networking')
fetchRetry.exponentialBackoff('http://example.com', {})
2.x.x
:
const { HttpExponentialBackoff } = require('@adobe/aio-lib-core-networking')
const fetchRetry = new HttpExponentialBackoff()
fetchRetry.exponentialBackoff('http://example.com', {})
Function signatureUtils::getKeyFromCache :
aio-lib-events/src/signatureUtils.js
Lines 112 to 134 in bfb5e17
On error, the function returns null, and never rethrows an Error.
The test "Test Get Key from Cache -> get key from cache throws" in signatureUtils.test.js is an invalid test since the tested function will never throw an error. In fact the test is bogus - it doesn't really test the return value or catch the function's error - it tests an error that it sets up itself.
The test is here:
aio-lib-events/test/signatureUtils.test.js
Lines 109 to 121 in bfb5e17
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.