Skip to content

Commit

Permalink
[Stabilization fix] - Silently fail decoding (#7719)
Browse files Browse the repository at this point in the history
* silence our logs and risons

* bump version
  • Loading branch information
Zasa-san authored Feb 25, 2025
1 parent 17af213 commit b13d223
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion app/react/utils/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Jvent from 'jvent';
import rison from 'rison-node';

const logger = console.log;

export function getPropsFromRoute({ routes }, componentProps) {
const props = {};
const lastRoute = routes[routes.length - 1];
Expand All @@ -18,10 +20,16 @@ export function getPropsFromRoute({ routes }, componentProps) {

export function risonDecodeOrIgnore(query, defaultValue = {}) {
try {
console.log = () => {};
return rison.decode(query);
} catch (e) {
console.log('Error decoding: ', query, e);
// silently failing until https://github.com/huridocs/Internal-Issues/issues/266 can be solved
// console.log('Error decoding: ', query, e);
return defaultValue;
} finally {
// silence the console.log until we can fix the error mentioned above
// to avoid rison throwing console.logs
console.log = logger;
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uwazi",
"version": "1.202.0-rc3",
"version": "1.202.0-rc4",
"description": "Uwazi is a free, open-source solution for organising, analysing and publishing your documents.",
"keywords": [
"react"
Expand Down

0 comments on commit b13d223

Please sign in to comment.