Open stgarf opened 5 years ago
@thomasbrueggemann just wondering if you maybe had a chance to try this out... latest paperless docker container and latest paperless-desktop release :(.
Okay, I finally got bothered enough to dig into javascript and electron applications :(
Looks like the bug was possibly introduced with PR #45. Seems like the return(TagDot</>);
is failing here
On my local instance I made the file look as follows with this patch file and Paperless-Desktop loads properly š however the sidebar doesn't work properly š.
I hope this helps narrow down the issue @NickBusey @thomasbrueggemann. Thanks!
From 4169e2803ad2aeb9f6abc10cd718ed43e83edac8 Mon Sep 17 00:00:00 2001
From: Steve Garf <stgarf@gmail.com>
Date: Fri, 8 Mar 2019 05:12:23 -0800
Subject: [PATCH 1/1] Wrap failing statement in try/except block.
---
js/src/components/DocumentItem.js | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/js/src/components/DocumentItem.js b/js/src/components/DocumentItem.js
index 9eef223..dca0da6 100644
--- a/js/src/components/DocumentItem.js
+++ b/js/src/components/DocumentItem.js
@@ -58,13 +58,17 @@ class DocumentItem extends PaperlessComponent {
var tagRegex = /\/([0-9]+)\//;
var tagId = tagRegex.exec(tagUrl)[1];
var tag = tags[tagId];
- return (
- <TagDot
- tag={tag}
- key={"sidebar_tags_" + tag.id}
- setTagFilter={this.props.setTagFilter}
- />
- );
+ try {
+ return (
+ <TagDot
+ tag={tag}
+ key={"sidebar_tags_" + tag.id}
+ setTagFilter={this.props.setTagFilter}
+ />
+ );
+ } catch (err) {
+ console.log("An unknown error has occurred:", err);
+ }
})}
</div>
<small>{moment(this.props.document.created).format("LLLL")}</small>
--
2.17.2 (Apple Git-113)
Thanks for looking into it, @stgarf . I myself are running paperless v0.0.4.
I think the underlying issue here is API changes over time in paperless. Which is perfectly fine. But paperless-desktop has no way to deal with those.
Either all users use the same version of paperless - highly unlikely, or we introduce some sort of version detection system. Any contribution is happyly welcome. I am not able to contribute such a feature at the moment, due to my lack of sparetime.
@thomasbrueggemann Maybe in the future... but for now I'm actually working on the exact opposite of a GUI, paperless-cli :+1:.
Expected Behavior
Expected UI to load up all documents, correspondents, and tags.
Actual Behavior
UI partially loaded the left-side nav bar then presented an error message:![screen shot 2018-12-18 at 11 38 56 am](https://user-images.githubusercontent.com/1694002/50178556-bf1c0280-02b9-11e9-9dd6-7fbaf4b7877d.png)
Steps to Reproduce the Problem
ssh -NL 8000:localhost:8000 paperlessuser@192.168.1.47
http://localhost:8000/
Specifications
Here's some output from the debug console:
and (very similar to the last one, except triggered by clicking the documents button)
and