lionheart / lionheart/TipJarViewController

TipJarViewController - Tableview.reloadData() called on main thread

Open
#9 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
79
Forks
13
PR merge metrics
No merged PRs in 30d

Description

Seeing this in the latest version of TipJarViewController.

This is happening in the `productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse)` function in `TipJarViewController`.

`Main Thread Checker: UI API called on a background thread: -[UITableView reloadData]
PID: 8441, TID: 2593234, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0
Backtrace:
4 TipJarViewController 0x0000000105b19418 $s20TipJarViewControllerAAC15productsRequest_10didReceiveySo010SKProductsF0C_So0I8ResponseCtF + 1184
5 TipJarViewController 0x0000000105b19748 $s20TipJarViewControllerAAC15productsRequest_10didReceiveySo010SKProductsF0C_So0I8ResponseCtFTo + 100
6 StoreKit 0x00000001bf55b858 0F0A30BF-E9E6-3199-BEBB-26402D218695 + 75864
7 libdispatch.dylib 0x0000000105bcde48 _dispatch_call_block_and_release + 32
8 libdispatch.dylib 0x0000000105bcf2a8 _dispatch_client_callout + 20
9 libdispatch.dylib 0x0000000105bd1b1c _dispatch_queue_override_invoke + 924
10 libdispatch.dylib 0x0000000105be0aac _dispatch_root_queue_drain + 356
11 libdispatch.dylib 0x0000000105be1418 _dispatch_worker_thread2 + 144
12 libsystem_pthread.dylib 0x00000001b05dea60 _pthread_wqthread + 216
13 libsystem_pthread.dylib 0x00000001b05e4c78 start_wqthread + 8
2019-09-24 07:07:05.877766-0700 Karl[8441:2593234] [reports] Main Thread Checker: UI API called on a background thread: -[UITableView reloadData]
PID: 8441, TID: 2593234, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0
Backtrace:
4 TipJarViewController 0x0000000105b19418 $s20TipJarViewControllerAAC15productsRequest_10didReceiveySo010SKProductsF0C_So0I8ResponseCtF + 1184
5 TipJarViewController 0x0000000105b19748 $s20TipJarViewControllerAAC15productsRequest_10didReceiveySo010SKProductsF0C_So0I8ResponseCtFTo + 100
6 StoreKit 0x00000001bf55b858 0F0A30BF-E9E6-3199-BEBB-26402D218695 + 75864
7 libdispatch.dylib 0x0000000105bcde48 _dispatch_call_block_and_release + 32
8 libdispatch.dylib 0x0000000105bcf2a8 _dispatch_client_callout + 20
9 libdispatch.dylib 0x0000000105bd1b1c _dispatch_queue_override_invoke + 924
10 libdispatch.dylib 0x0000000105be0aac _dispatch_root_queue_drain + 356
11 libdispatch.dylib 0x0000000105be1418 _dispatch_worker_thread2 + 144
12 libsystem_pthread.dylib 0x00000001b05dea60 _pthread_wqthread + 216
13 libsystem_pthread.dylib 0x00000001b05e4c78 start_wqthread + 8`

Contributor guide

No contributing guide indexed for this repository

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 in TipJarViewController at productsRequest(_:didReceive:), where the report identifies UITableView.reloadData as running on a background thread. Reproduce with the Main Thread Checker and verify that the table reload occurs on the main thread without the warning.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.