Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feed corruption; a question about spelunking #220

Open
2 tasks done
robinsloan opened this issue May 21, 2021 · 10 comments
Open
2 tasks done

Feed corruption; a question about spelunking #220

robinsloan opened this issue May 21, 2021 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@robinsloan
Copy link

  • I have checked the Common Problems page.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.
  • OS: Mac
  • Browser: Chrome
  • Version: 90

Something a bit mysterious has happened a few times now, where I add a feed and, for unknown reasons, the Fraidycat Chrome extension bugs out, showing me this

image

and, in the console, this

image

I'd like to do a little investigating myself, and maybe even figure out what the issue with the newly-added feed is (I get the impression it didn't quite "get added correctly", whatever that might mean) but I don't know where to look.

My question: is it possible to inspect (and maybe even edit) the extension's synced feed list somewhere in Chrome, either using the JS console or some other tool? If anyone can point me in the right direction for spelunking, I'd be happy to investigate (and report back, if desired).

Thank you!

@robinsloan robinsloan added the bug Something isn't working label May 21, 2021
@robinsloan
Copy link
Author

(I should add: previously, I "fixed" this problem by reinstalling the extension and reimporting my OPML file. This time I would like to try to figure out what's actually going on...)

@kickscondor
Copy link
Owner

kickscondor commented May 21, 2021

Yeah let's get this situation improved - it's no good to have to keep re-importing. The console pic here helps a lot.

I'm guessing you use Fraidycat on multiple machines and are logged-in to Chrome? Or just a single browser here?

Here are some details on 'spelunking' if you're curious: https://github.com/kickscondor/fraidycat/wiki/Spelunking-Fraidycat's-Save-Files

@robinsloan
Copy link
Author

robinsloan commented May 21, 2021

Kicks Condor, this is terrific! Thank you so much! I am going to rappel down & report back. If you don't hear from me in 72 hours, drop a box of Cheez-Its.

I'm guessing you use Fraidycat on multiple machines and are logged-in to Chrome? Or just a single browser here?

Yes, that's right. I'll add a feed; something will feel… wonky; and when I hop over to the reader view, I get the broken screen depicted above. Then, the same error propagates to other computers, too.

@blipdrifter
Copy link

If it helps, this also sometimes happens to me on Firefox (latest version) too. Super annoying, but at least the browser sync works after reinstalling, so it's not a huge deal? But I'd still like to have this fixed.

@robinsloan
Copy link
Author

robinsloan commented May 22, 2021

@spriteclad Same here; I haven't been bothered by the need to reset, but I figured I'd investigate a little.

Here's what I've gathered. The problem was with this feed:

image

which is not really a feed, even though the page makes the Fraidycat glow invitingly. I believe it only causes a problem when you sort your feeds A-Z, as I do.

When I used chrome.storage.local.clear to zap my preferences, then closed & reopened Chrome, the sort order reverted to Fraidycat's default, and I was able to see the feed at the top of the page, displayed without a title. Then, when I switched the sort to A-Z, Fraidycat was zapped back to its broken state.

That's what I've learned so far! Now, to figure out which part of the code exactly is getting tripped up on that not-a-feed…

P.S. Peatlands rule

@robinsloan
Copy link
Author

Okay, so the acute problem is that my broken follow, in addition to… not being a feed… ends up with an actualTitle value that is not a string, but an odd object with the form

{rendered: "Here is the feed's title"}

which breaks the A-Z sorting when the sort function looks for this object's .localeCompare function, which it doesn't have. (Properly functioning follows have actualTitle values that are strings.)

I haven't yet been able to figure out where or why that weird object is generated.

It's possible to fix the error by checking for string-ness in the followTitle generator function in utils.js, like so:

export function followTitle(follow) {
  let title = follow.title || follow.actualTitle || follow.url
  if (typeof title !== "string") {
    title = "..."
  }
  return title
}

I've done this, and it helps! I'm happy to submit that patch, BUT, I acknowledge that it feels like a band-aid rather than an actual solution to whatever deeper problem is causing this URL not to be rejected in the first place, so, if this edit just feels like it will make things messy/random, I totally understand.

Let me know; and in the meantime, I will keep investigating the root cause.

@kickscondor
Copy link
Owner

kickscondor commented May 24, 2021

Ah, way to sleuth, Robin! This is so helpful. The JSON it's loading comes from https://peatlands.org/wp-json/wp/v2/pages/587 (redirected from https://peatlands.org/peatlands/what-are-peatlands/) - which ends up loading as this object:

{
  title: { rendered: 'What are peatlands?' },
  photos: {},
  status: [],
  posts: []
}

I am tightening up the feed-loading code to catch any odd objects like this that may show up in titles or descriptions or anything like that. I am very grateful for the work you put into tracking this down! After all you are doing - to take the time to mess around in Fraidycat's guts... I'm not worthy of such gifts as you give, my friend.

@robinsloan
Copy link
Author

robinsloan commented May 25, 2021

Just happy to be mildly helpful! Let me know if there's anything else I can do to assist.

@kickscondor
Copy link
Owner

Okieeee - this is out! Version 1.1.10 slid through all the web stores, no probs. Please let me know if this doesn't do it for you. (Perhaps there are other feed issues that I'm not catching.)

@blipdrifter
Copy link

Okieeee - this is out! Version 1.1.10 slid through all the web stores, no probs. Please let me know if this doesn't do it for you. (Perhaps there are other feed issues that I'm not catching.)

Aaaand it doesn't do it for me. Just woke up from a two-hour nap to find this in my browser, having to reinstall fraidycat AGAIN:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants