Comments (3)
Also,
Would it be possible to fix this and achieve the old behavior of returning null as expected?
one possible solution is:
If PubNub instance is initialised with cryptoModule and if subscription received unencrypted message then
listener with receive message as it's original form and message.error will contain error message.
you can implement a quick logic to return null from there if there is any failure.
or try catch-error with manual decryption if that is compatible with other app logic!
from javascript.
Initialising PubNub instance along with cryptoModule(legacyCryptoModule
or aesCbcCryptoModule
) won't break the listener in case of mixture of encrypted/unencrypted messages. pubnub initialisation with cryptoModule example snippet is here
In the description code snippet, Message is being decrypted manually. In case of possible unencrypted message, we need to catch the error and return null. If we want to return null instead original unencrypted message
Reason: cryptoModules are able to decrypted both 128 and 256 bit encrypted messages for backward compatibility. So now decrypt
method throws Error with error message about failure reason instead returning null. So that user of native decrypt method can handle various scenarios based on failure reason.
from javascript.
Initialising PubNub instance along with cryptoModule(
legacyCryptoModule
oraesCbcCryptoModule
) won't break the listener in case of mixture of encrypted/unencrypted messages. pubnub initialisation with cryptoModule example snippet is hereIn the description code snippet, Message is being decrypted manually. In case of possible unencrypted message, we need to catch the error and return null. If we want to return null instead original unencrypted message
Reason: cryptoModules are able to decrypted both 128 and 256 bit encrypted messages for backward compatibility. So now
decrypt
method throws Error with error message about failure reason instead returning null. So that user of native decrypt method can handle various scenarios based on failure reason.
Thank you so much for the quick response. We need to use manual decryption for now so will catch & handle the error accordingly. 👍
Also would like to request a couple of updates in the guide here in the section If you are not specifying the cipher key as part of your PubNub configuration but encrypting messages as needed:
- About mentioning the error handling change for the manual decryption method.
- About updating the statement adding the CryptoModule to the SDKs was a non-breaking change in the best feasible manner, as this small issue might be a breaking change for some users of JS SDK.
Thanks again!
from javascript.
Related Issues (20)
- PubNub v7.2.0 import/require cycles warning HOT 2
- get_file_url should support both token manager token and auth key like other endpoints HOT 2
- Any chance this libary will be updated to support Service Workers HOT 1
- Subscribe api keeps pending
- Buttons in smaller devices touches each other HOT 7
- Button width is not responsive in smaller device HOT 2
- deprecated [email protected] HOT 3
- Listener exception generates status 400, error should contain contextual error information HOT 3
- PNNetworkIssuesCategory in ios ionic capacitor app HOT 2
- vm2 resulting in critical Audit failure for PubNub SDK HOT 6
- @types/pubnub missing getToken HOT 2
- messages not compressed
- pubnub.push.listChannels only return 500 channels MAX
- What's the deal with the license? HOT 1
- Accessing active listeners HOT 6
- Case sensitive path issue HOT 1
- Formidable / Superagent Build Issue With Nextjs & Typescript HOT 9
- i am getting internal server error while using the message action api in pubnub HOT 1
- Documentation around the setProxy method
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javascript.