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

Stuck in setup() loop #13

Open
seanknox opened this issue Jun 13, 2016 · 3 comments
Open

Stuck in setup() loop #13

seanknox opened this issue Jun 13, 2016 · 3 comments

Comments

@seanknox
Copy link

Hi,

My new Starboard app is stuck in an endless setup() loop. The app is successfully able to authorize with Trello, download the guides from the doc repo on GitHub, but setup() repeatedly catches an error. Inspecting the error, it's actually the data.json from the JSON fetch, so I'n not sure what's triggering an error.

Also strange is that after repeated fails, the ultimate POST to guides to refresh the guides uses a newly generated starboard.token—it doesn't use the existing set one.

# Once we've authorized with trello
setup = (retry_count)->
  log.debug("setup")

  retry_count ||= 3

  # Get the team map
  # the fetch triggers an error, strangely 
  $.getJSONAsync('guides/data.json').then((data) ->
    $("section.loading").addClass("hidden")
    root.starboard.information = data
    prepareForm(data["teams"])  
  ).catch((error) ->  # inspecting the error object shows that it's fetched data.json
    $("section.loading").removeClass("hidden")
    # If we fails, refresh guides and retry
    $.post("/guides?t=#{starboard.token}", ->
      setup(retry_count - 1)
    )
  )

starboard

@ys
Copy link
Contributor

ys commented Jun 13, 2016

Hey Sean,

Thanks a lot for the feedback, it is using a self generated token that is cached in redis... it is a bit confusing. I will see what I can do to fix that really soon.

@seanknox
Copy link
Author

Thanks Yannick! Just to confirm, is the self-generated token issue somehow related to$.getJSONAsync throwing an error?

@ys
Copy link
Contributor

ys commented Jun 13, 2016

A 401 Unauthorized error there looks like that yes.
I will investigate a bit on that and see how I can fix it.

On Jun 13, 2016, at 11:00 AM, Sean Knox notifications@github.com wrote:

Thanks Yannick! Just to confirm, is the self-generated token issue somehow related to$.getJSONAsync throwing an error?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #13 (comment), or mute the thread https://github.com/notifications/unsubscribe/AAdexDLcJRIVETMC2-ZH1RYZ7IR7iegeks5qLZrNgaJpZM4Iz_F-.

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

2 participants