PR Description
Summary
This PR fixes issues with the auto-renewal expiration detection logic in the message verifier, specifically addressing problems with enterprise app spec comparison.
Changes
-
Replace JSON.stringify comparison with deep equality check - The previous
isExpireOnlyUpdatefunction usedJSON.stringify()to compare app specs, which is order-dependent and could fail when object properties are in different orders. Added a customdeepEqualfunction that correctly compares objects regardless of property order. -
Change address that can extend apps for a new address (not known), previous address was not used yet as it was not working.
-
Fix enterprise app spec decryption for existing specs - For v8+ enterprise apps, only the new spec was being decrypted before comparison. The existing spec also needs to be decrypted to properly compare the two specs. This was causing auto-renew validation to fail for enterprise apps because encrypted specs were being compared against decrypted ones.
-
Add debug logging - Added informative log messages to
isExpireOnlyUpdateto help diagnose comparison failures and confirm successful matches.
Files Changed
ZelBack/src/services/appMessaging/messageVerifier.js
Technical Details
The isExpireOnlyUpdate function is used to validate that a userToExtend address can only extend an app's expiration without making other changes. The fix ensures:
- Both new and existing enterprise specs are decrypted before comparison
- Object comparison works correctly regardless of JSON property ordering
- Proper logging for troubleshooting renewal issues
Testing
- Verified that expire-only updates are correctly detected for both regular and enterprise apps
- Confirmed that property order differences no longer cause false negatives