Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Channels not loading #224

Closed
jackjamieson2 opened this issue Aug 7, 2018 · 8 comments
Closed

Channels not loading #224

jackjamieson2 opened this issue Aug 7, 2018 · 8 comments

Comments

@jackjamieson2
Copy link

When I open indigenous, it does not load my channels list.

My server logs indicate that indigenous made a valid request for channels, so should have received a proper response.

Using my in-development microsub server, so this might be an error on my end, but both Monocle and Together load the channels successfully.

Below is the json that indigenous should be receiving. I'll do some additional testing this week to try to narrow things down.

Some additional background at indieweb/wordpress-micropub#147

{
  "channels": [
    {
      "uid": "test",
      "name": "IndieWeb",
      "items": [
        {
          "type": "feed",
          "url": "http:\\/\\/tantek.com\\/"
        },
        {
          "type": "feed",
          "url": "http:\\/\\/aaronparecki.com\\/\\/all"
        },
        {
          "type": "feed",
          "url": "http:\\/\\/gregorlove.com\\/"
        },
        {
          "type": "feed",
          "url": "https:\\/\\/unicyclic.com\\/mal\\/blog"
        },
        {
          "type": "feed",
          "url": "http:\\/\\/jackjamieson.net\\/"
        },
        {
          "type": "feed",
          "url": "https:\\/\\/werd.io\\/content\\/all"
        },
        {
          "type": "feed",
          "url": "https:\\/\\/snarfed.org\\/"
        }
      ]
    },
    {
      "uid": "test-2",
      "name": "testing channe"
    },
    {
      "uid": "test-3",
      "name": "News",
      "items": [
        {
          "type": "feed",
          "url": "https:\\/\\/api.axios.com\\/feed\\/top\\/"
        }
      ]
    },
    {
      "uid": "journals",
      "name": "Journals",
      "items": [
        {
          "type": "feed",
          "url": "http:\\/\\/firstmonday.org\\/ojs\\/index.php\\/fm\\/gateway\\/plugin\\/WebFeedGatewayPlugin\\/rss2"
        }
      ]
    },
    {
      "uid": "academics",
      "name": "Academics",
      "items": [
        {
          "type": "feed",
          "url": "http:\\/\\/feeds.feedburner.com\\/nsfworkshop"
        },
        {
          "type": "feed",
          "url": "http:\\/\\/www.gamespace.nl\\/feed\\/"
        }
      ]
    }
  ]
}

@EdwardHinkle
Copy link
Collaborator

So I believe the issue is the items array.

  1. Swift is very picky when it comes to JSON. I need to find a way to make Indigenous more forgiving. Or at least presenting those errors. So when my code sees the items array it breaks and doesn’t get the channels imported.

  2. I don’t think that items array should exist: https://indieweb.org/Microsub-spec#Channels_2

@jackjamieson2
Copy link
Author

Ah, that makes sense! Thanks for checking it out

I'd structured the data that way for convenience elsewhere, and forgot to strip out the items when returning the channels list. Since the other readers were more forgiving I didn't notice that I'm not following the spec. I'll change that tomorrow and confirm, but I think you're probably right.

@jackjamieson2
Copy link
Author

I'm still having the same problem after I removed the items arrays. I've tried with two formats.

  1. With no 'unread' field
{
  "channels": [
    {
      "uid": "test",
      "name": "IndieWeb"
    },
    {
      "uid": "test-2",
      "name": "testing channe"
    },
    {
      "uid": "test-3",
      "name": "News"
    },
    {
      "uid": "journals",
      "name": "Journals"
    },
    {
      "uid": "academics",
      "name": "Academics"
    }
  ]
}
  1. With a hard-coded 'unread' field for testing
{
  "channels": [
    {
      "uid": "test",
      "name": "IndieWeb",
      "unread": 10
    },
    {
      "uid": "test-2",
      "name": "testing channe",
      "unread": 10
    },
    {
      "uid": "test-3",
      "name": "News",
      "unread": 10
    },
    {
      "uid": "journals",
      "name": "Journals",
      "unread": 10
    },
    {
      "uid": "academics",
      "name": "Academics",
      "unread": 10
    }
  ]
}

I think that should be valid, but please let me know if you think otherwise. Thanks!

jackjamieson2 added a commit to jackjamieson2/yarns-microsub-server that referenced this issue Aug 8, 2018
The channel list was being returned along with a list of each channel's subscribed feeds. This does not conform to the Microsub spec and may be causing indigenous for ios to have trouble loading channels (IndiePass/indiepass-ios#224)

Added pagination when fetching timeline.  Tested briefly and it seems to work so I'll cross my fingers.  Addresses #7
@EdwardHinkle
Copy link
Collaborator

Hmm strange. That does look valid. I might have to install Yarn on my test Wordpress instance to figure this one out

@jackjamieson2
Copy link
Author

Thanks @EdwardHinkle. Please let me know if you have any ideas and I'll do the same.

@mayo
Copy link

mayo commented Sep 14, 2018

Is this possibly related to #229?

@jackjamieson2
Copy link
Author

Hi @mayo, that's a good idea but in this case I've tried uninstalling and reinstalling indigenous several times.

I haven't gotten any further with this yet, but my thoughts are it could be:

  1. Authorization - maybe my server is not allowing Indigenous to authorize correctly, and the channels request is simply the first one to fail.

  2. Channel formatting - The json structure seems right, but perhaps my response type is wrong (as far as I can see in brower-based clients and in my testing, the response is valid json but @EdwardHinkle mentioned swift is particularly strict about that sort of thing)

In either case, the mystery is why my server works with other clients, and Indigenous works with other servers - so it might be a weird combination of minor issues on both ends 🤷‍♂

@jackjamieson2
Copy link
Author

I am delighted that this seems to be fixed in jackjamieson2/yarns-microsub-server@ca74729

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants