fedwiki / wiki-server

Federated Wiki client and server in Node.js
Other
153 stars 35 forks source link

Rejected Actions Silently Fail #51

Closed WardCunningham closed 10 years ago

WardCunningham commented 10 years ago

https://github.com/fedwiki/wiki-node-server/blob/master/lib/server.coffee#L345

This put exits with a 403 when a 404 is expected by the client code in this situation.

I've tried to recreate this error which happened as I was working on another bug. It has something to do with persona getting out of sync with the server. I will continue to isolate the error conditions.

paul90 commented 10 years ago

I have noticed that the persona steps can be very slow at times, so much so I have ended up with some inadvertent page forks as the page moves when it starts to refresh. Only really a problem if opening a link which opens with a number of pages, but then the page fresh gets very annoying.

The code looks a bit different than in the ruby version, there it is:

    unless authenticated? or (!identified? and !claimed?)
      halt 403
      return
    end

while here it is:

    if req.isAuthenticated()
      next()
    else
      console.log 'rejecting', req.path
      res.send(403)

not sure either is quite right, as we really should be checking to see if we are authorized. Though currently we get away with just checking authenticated, as we only allow the owner to login.

WardCunningham commented 10 years ago

Hmm. 403 may not be the culprit then. In the rush to test idea many error conditions have been ignored. The ideas have been largely proven but the software is not yet rock solid. Intermittent internet from a mobile device will be the torture test.

WardCunningham commented 10 years ago

I think I will close this until there is more to go on.