Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Posting review comments fails #1784

Closed
BasThomas opened this issue Apr 30, 2018 · 7 comments
Closed

Posting review comments fails #1784

BasThomas opened this issue Apr 30, 2018 · 7 comments
Labels
🐛 bug Unintended behaviour within the app
Projects

Comments

@BasThomas
Copy link
Collaborator

Trying to comment on the review in MessageKit/MessageKit#666 shows a “Something went wrong”.

Bug Report Dump (Auto-generated)
Version 1.19.0 (1524439576)
Device: iPad7,3 (iOS 11.3)
TestFlight: false
@BasThomas BasThomas added the 🐛 bug Unintended behaviour within the app label Apr 30, 2018
@BasThomas
Copy link
Collaborator Author

BasThomas commented Apr 30, 2018

It throws here.

The JSON that we fail to parse:

▿ 2 elements
  ▿ 0 : 2 elements
    - key : "documentation_url"
    - value : https://developer.github.com/v3/pulls/comments/#create-a-comment
  ▿ 1 : 2 elements
    - key : "message"
    - value : Not Found

This is the request:

▿ V3SendPullRequestCommentRequest
  - owner : "MessageKit"
  - repo : "MessageKit"
  - number : 666
  - body : "Test"
  - inReplyTo : 184918061

@rnystrom
Copy link
Member

rnystrom commented May 6, 2018

So posting to this comment returns a 404, but replying to other PR threads works.

(lldb) po response
▿ [Request]: POST https://api.github.com/repos/MessageKit/MessageKit/pulls/666/comments
[Response]: <NSHTTPURLResponse: 0x60800043c900> { URL: https://api.github.com/repos/MessageKit/MessageKit/pulls/666/comments } { Status Code: 404, Headers {
    "Access-Control-Allow-Origin" =     (
        "*"
    );
    "Access-Control-Expose-Headers" =     (
        "ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval"
    );
    "Content-Encoding" =     (
        gzip
    );
    "Content-Security-Policy" =     (
        "default-src 'none'"
    );
    "Content-Type" =     (
        "application/json; charset=utf-8"
    );
    Date =     (
        "Sun, 06 May 2018 00:17:44 GMT"
    );
    "Referrer-Policy" =     (
        "origin-when-cross-origin, strict-origin-when-cross-origin"
    );
    Server =     (
        "GitHub.com"
    );
    Status =     (
        "404 Not Found"
    );
    "Strict-Transport-Security" =     (
        "max-age=31536000; includeSubdomains; preload"
    );
    "Transfer-Encoding" =     (
        Identity
    );
    "X-Accepted-OAuth-Scopes" =     (
        ""
    );
    "X-Content-Type-Options" =     (
        nosniff
    );
    "X-Frame-Options" =     (
        deny
    );
    "X-GitHub-Media-Type" =     (
        "github.v3; format=json"
    );
    "X-GitHub-Request-Id" =     (
        "9CB8:75DB:2096332:4D00B96:5AEE49A8"
    );
    "X-OAuth-Client-Id" =     (
        a8488ca1ed943b610815
    );
    "X-OAuth-Scopes" =     (
        "notifications, repo, user"
    );
    "X-RateLimit-Limit" =     (
        5000
    );
    "X-RateLimit-Remaining" =     (
        4994
    );
    "X-RateLimit-Reset" =     (
        1525569087
    );
    "X-Runtime-rack" =     (
        "0.035767"
    );
    "X-XSS-Protection" =     (
        "1; mode=block"
    );
} }
[Data]: 110 bytes
[Result]: SUCCESS: 110 bytes
[Timeline]: Timeline: { "Request Start Time": 547258664.175, "Initial Response Time": 547258664.729, "Request Completed Time": 547258664.729, "Serialization Completed Time": 547258664.729, "Latency": 0.554 secs, "Request Duration": 0.554 secs, "Serialization Duration": 0.000 secs, "Total Duration": 0.554 secs }
  ▿ request : Optional<URLRequest>
    ▿ some : https://api.github.com/repos/MessageKit/MessageKit/pulls/666/comments
      ▿ url : Optional<URL>
        ▿ some : https://api.github.com/repos/MessageKit/MessageKit/pulls/666/comments
      - cachePolicy : 0
      - timeoutInterval : 60.0
      - mainDocumentURL : nil
      - networkServiceType : __ObjC.NSURLRequest.NetworkServiceType
      - allowsCellularAccess : true
      ▿ httpMethod : Optional<String>
        - some : "POST"
      ▿ allHTTPHeaderFields : Optional<Dictionary<String, String>>
        ▿ some : 1 element
          ▿ 0 : 2 elements
            - key : "Content-Type"
            - value : "application/json"
      ▿ httpBody : Optional<Data>
        ▿ some : 97 bytes
          - count : 97
          ▿ pointer : 0x00006080002ed990
            - pointerValue : 106102875150736
      - httpBodyStream : nil
      - httpShouldHandleCookies : true
      - httpShouldUsePipelining : false
  ▿ response : Optional<NSHTTPURLResponse>
  ▿ data : Optional<Data>
    ▿ some : 110 bytes
      - count : 110
      ▿ pointer : 0x0000608000157290
        - pointerValue : 106102873485968
  ▿ result : SUCCESS: 110 bytes
    ▿ success : 110 bytes
      - count : 110
      ▿ pointer : 0x0000608000157290
        - pointerValue : 106102873485968
  ▿ timeline : Timeline: { "Request Start Time": 547258664.175, "Initial Response Time": 547258664.729, "Request Completed Time": 547258664.729, "Serialization Completed Time": 547258664.729, "Latency": 0.554 secs, "Request Duration": 0.554 secs, "Serialization Duration": 0.000 secs, "Total Duration": 0.554 secs }
    - requestStartTime : 547258664.17475605
    - initialResponseTime : 547258664.72867501
    - requestCompletedTime : 547258664.72909296
    - serializationCompletedTime : 547258664.72922397
    - latency : 0.55391895771026611
    - requestDuration : 0.55433690547943115
    - serializationDuration : 0.00013101100921630859
    - totalDuration : 0.55446791648864746
  ▿ _metrics : Optional<AnyObject>

@rnystrom
Copy link
Member

rnystrom commented May 6, 2018

Really not sure what's going on w/ this. It's something to do w/ the scopes we're requesting. If I use a PAT, it works. If I actually login, it doesn't work...

The craziest thing is that my PAT has less scopes (repo, user).

@webern
Copy link

webern commented Aug 12, 2018

I have also experienced this bug when trying add a reply to an issue that I had opened, here
nodejs/abi-stable-node-addon-examples#12

@rnystrom rnystrom added this to High priority in Bugs Aug 13, 2018
@ghost
Copy link

ghost commented Aug 23, 2018

I cannot reproduce this issue on the prod branch. I suspect it's a bug in the GitHub API V3.

Requests that require authentication will return 404 Not Found, instead of 403 Forbidden, in some places. This is to prevent the accidental leakage of private repositories to unauthorized users.

Maybe this mechanism is broken on GitHub side?

@rnystrom rnystrom removed the high label Dec 2, 2018
@ikifof
Copy link

ikifof commented Apr 19, 2019

This is still happening... and annoyingly the apps does not keep the message when it fails to send it.

@BasThomas
Copy link
Collaborator Author

Oh noes. Would you like to open a ticket to at least persist the message when it fails to send, @ikifof?

Bugs automation moved this from High priority to Closed Nov 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Unintended behaviour within the app
Projects
Bugs
Closed
Development

No branches or pull requests

4 participants