matrix-org / matrix-org/matrix-ios-sdk

[MXHTTPClient] cleanupBackgroundTask keyNotFound(CodingKeys(stringValue: "msgtype", intValue: nil)

Open
#1,276 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C
Stars
484
Forks
225
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
During the sync of our E2E encrypted mobile client we notice an error message in console output:

`[MXHTTPClient] cleanupBackgroundTask
keyNotFound(CodingKeys(stringValue: "msgtype", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key CodingKeys(stringValue: \"msgtype\", intValue: nil) (\"msgtype\").", underlyingError: nil))`

full log

```
2021-10-26 12:33:51.085697+0200 [2751:509035] [MXHTTPClient] #70 - GET _matrix/client/r0/sync
2021-10-26 12:33:51.090745+0200 [2751:514742] ⚠️ [MXRoomLastMessage] encryptData: no key method provided for encryption.
2021-10-26 12:33:51.096359+0200 [2751:509035] [MXFileStore commit] lasted 19ms
2021-10-26 12:33:51.096498+0200 [2751:509035] [MXSyncResponseFileStore] readMetaData: File does not exist
2021-10-26 12:33:51.096587+0200 [2751:509035] [MXSyncResponseFileStore] readMetaData: File does not exist
2021-10-26 12:33:51.096725+0200 [2751:514742] [MXSyncResponseFileStore] saveMetaData: Remove file
2021-10-26 12:33:51.157806+0200 [2751:509035] [MXHTTPClient] #69 - POST _matrix/client/r0/keys/upload completed in 80ms
2021-10-26 12:33:51.157949+0200 [2751:514768] [MXCrypto] generateAndUploadFallbackKey: Finished uploading fallback key.
2021-10-26 12:33:51.158043+0200 [2751:509035] [MXHTTPClient] cleanupBackgroundTask
keyNotFound(CodingKeys(stringValue: "msgtype", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key CodingKeys(stringValue: \"msgtype\", intValue: nil) (\"msgtype\").", underlyingError: nil))
2021-10-26 12:33:54.824739+0200 [2751:509035] [MXHTTPClient] #70 - GET _matrix/client/r0/sync completed in 3738ms
2021-10-26 12:33:54.826220+0200 [2751:509035] [MXHTTPClient] cleanupBackgroundTask
2021-10-26 12:33:54.827451+0200 [2751:509035] [MXSession] Received sync response in 3742ms
```

**To Reproduce**
Steps to reproduce the behavior:
1. Enable e2e encryption as described in #1254
2. Receive an encrypted file
3. Observe console output

**Expected behavior**
No warning / error about key decoding should be thrown.

**Smartphone (please complete the following information):**
- Device: iPhone 12
- OS: iOS 15.0.2
- Version `v0.20.3`

**Additional context**
E2E Encryption is enabled

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at MXHTTPClient.cleanupBackgroundTask and trace the response handling reached during _matrix/client/r0/sync and key upload requests. Reproduce the issue by enabling end-to-end encryption and receiving an encrypted file, then verify that the keyNotFound warning no longer appears in console output.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
api, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.