diff --git a/imports/api/Fires/server/publications.js b/imports/api/Fires/server/publications.js index 96d6a85..47109cb 100644 --- a/imports/api/Fires/server/publications.js +++ b/imports/api/Fires/server/publications.js @@ -132,14 +132,20 @@ Meteor.publish('fireFromId', function fireFromId(_id) { } }); -Meteor.publish('fireFromHash', function fireFromHash(fireEnc) { +function logUrl(fireEnc, params) { + console.log(`Wrong fire: ${fireEnc}.`); + console.log(`Params received in url: ${JSON.stringify(params)}`); +} + +Meteor.publish('fireFromHash', function fireFromHash(fireEnc, params) { check(fireEnc, String); + check(params, Object); try { // console.log(fireEnc); // const unsealed = Promise.await(urlEnc.decrypt(fireEnc)); const unsealed = Promise.await(unsealW(fireEnc)); if (unsealed === undefined) { - console.info(`Wrong fire: ${fireEnc}`); + logUrl(fireEnc, params); // https://guide.meteor.com/data-loading.html return this.ready(); } @@ -158,6 +164,7 @@ Meteor.publish('fireFromHash', function fireFromHash(fireEnc) { * return fire; */ } catch (e) { console.warn(e); + logUrl(fireEnc, params); return this.ready(); } }); diff --git a/imports/ui/pages/Fires/Fires.js b/imports/ui/pages/Fires/Fires.js index 9862933..0e4271a 100644 --- a/imports/ui/pages/Fires/Fires.js +++ b/imports/ui/pages/Fires/Fires.js @@ -278,7 +278,7 @@ const FireContainer = withTracker(({ match }) => { } else { console.log('Seems a fire from enc hash'); fromHash = true; - subscription = Meteor.subscribe('fireFromHash', id); + subscription = Meteor.subscribe('fireFromHash', id, match.params); } // console.log(`Type of '${fireType}' fire, active: ${active}, archive: ${archive}, fromHash: ${fromHash}`);