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

400 bad request with text message from line #16

Open
daktak opened this issue Jul 15, 2022 · 5 comments
Open

400 bad request with text message from line #16

daktak opened this issue Jul 15, 2022 · 5 comments

Comments

@daktak
Copy link
Contributor

daktak commented Jul 15, 2022


HTTPError: Request failed with status code 400
    at HTTPClient.wrapError (/pub/git/matrix-line-bridge/node_modules/@line/bot-sdk/dist/http.js:89:20)
    at /pub/git/matrix-line-bridge/node_modules/@line/bot-sdk/dist/http.js:19:88
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async HTTPClient.get (/pub/git/matrix-line-bridge/node_modules/@line/bot-sdk/dist/http.js:22:21)
    at async Client.getChatMemberProfile (/pub/git/matrix-line-bridge/node_modules/@line/bot-sdk/dist/client.js:81:25)
    at async Function.fromLineSource (/pub/git/matrix-line-bridge/src/providers/matrix/sender.ts:25:13)
    at async Object.exports.default [as text] (/pub/git/matrix-line-bridge/src/providers/line/listener/message/text.ts:163:20)
    at async Promise.all (index 0)
    at async eventsDispatcher (/pub/git/matrix-line-bridge/src/providers/line/listener/handler.ts:44:22) {
  statusCode: 400,
  statusMessage: 'Bad Request',
  originalError: Error: Request failed with status code 400
      at createError (/pub/git/matrix-line-bridge/node_modules/@line/bot-sdk/node_modules/axios/lib/core/createError.js:16:15)
      at settle (/pub/git/matrix-line-bridge/node_modules/@line/bot-sdk/node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (/pub/git/matrix-line-bridge/node_modules/@line/bot-sdk/node_modules/axios/lib/adapters/http.js:269:11)
      at IncomingMessage.emit (node:events:539:35)
      at IncomingMessage.emit (node:domain:475:12)
      at endReadableNT (node:internal/streams/readable:1344:12)
      at processTicksAndRejections (node:internal/process/task_queues:82:21) {
    config: {
      url: 'https://api.line.me/v2/bot/group/C69ad0082491aea0350cd616d9e9b506a/member/undefined',
      method: 'get',
      headers: [Object],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 0,
      adapter: [Function: httpAdapter],
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      validateStatus: [Function: validateStatus],
      transitional: [Object],
      data: undefined
    },
    request: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [TLSSocket],
      _header: 'GET /v2/bot/group/chatroomid/member/undefined HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Authorization: Bearer token\r\n' +
        'User-Agent: @line/bot-sdk/7.5.0\r\n' +
        'Host: api.line.me\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'GET',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/v2/bot/group/C69ad0082491aea0350cd616d9e9b506a/member/undefined',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'api.line.me',
      protocol: 'https:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(kUniqueHeaders)]: null
    },
    response: {
      status: 400,
      statusText: 'Bad Request',
      headers: [Object],
      config: [Object],
      request: [ClientRequest],
      data: [Object]
    },
    isAxiosError: true,
    toJSON: [Function: toJSON]
  }
}
@daktak
Copy link
Contributor Author

daktak commented Jul 15, 2022

Seems userId comes out as undefined, so if this is the case, dist/client.js:81 should not do a profile lookup, and just use "undefined" ?

@supersonictw
Copy link
Member

Umm... It's better to take a look why there is an "undefined" user. Did the user exit the group?

@daktak
Copy link
Contributor Author

daktak commented Jul 15, 2022

no user is still present in the group, is there a privacy setting?

@supersonictw
Copy link
Member

no user is still present in the group, is there a privacy setting?

Sorry late to reply. It might be the feature of Messaging API to preventing from privacy issues.

If it's caused, the better solution is showing the user as Unknown instead.

@supersonictw
Copy link
Member

I will test and fix the bug recently in Arona.

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

No branches or pull requests

2 participants