The Unwanted Communication Reporting extension sends response over the network connection only ONCE after installing. Is it a bug?

Hi,

I just have seen an issue in my project that the Unwanted Communication Reporting extension sends response over the network connection only ONCE after installing. In the second try, after pressing the Done button, I don't see any request sent to my external server. To send response again, I have to re-install the app.

But using SMS is still ok. Every time I press the Done button, the view used to compose SMS appears.

This is my Info.plist to send response over network connection:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>NSExtension</key>
	<dict>
		<key>NSExtensionAttributes</key>
		<dict>
			<key>ILClassificationExtensionNetworkReportDestination</key>
			<string>https://example.com/api</string>
		</dict>
		<key>NSExtensionPointIdentifier</key>
		<string>com.apple.identitylookup.classification-ui</string>
		<key>NSExtensionPrincipalClass</key>
		<string>$(PRODUCT_MODULE_NAME).UnwantedCommunicationReportingExtension</string>
	</dict>
</dict>
</plist>

The classificationResponse() function is still hit every time I press the Done button, but no request is sent to my external server, except the first try. This is my sample code used to confirm that behavior:

    // Provide a classification response for the classification request
    override func classificationResponse(for request:ILClassificationRequest) -> ILClassificationResponse {
        return ILClassificationResponse.init(action: .reportJunk)
    }

In addition, the Message Filtering extension (in same app) is running as expected.

I'm using:

  • iOS 15
  • Xcode 13

Any comment is highly appreciated. Thanks.

Update 17:00 GMT+7 05-Feb-2022

I have just found that if I force close the iOS Messages app, the report can be sent to my external server again. It means if I want to continue reporting, I have to force close the iOS Messages app first.

Does it mean there is something unfinished in the last workflow?

Once your view controller is dismissed, to protect user privacy, the system always deletes your extension’s container after your extension terminates.

Hi Rico,

Though I press "Cancel" in the iOS Messages application to end a session (according to my understanding), I must force close the iOS Messages application to make it work again.

I update steps to reproduce:

  1. Install the app contains a Message Filter extension and an Unwanted Communication extension
  2. Enable those 2 extensions in Settings (Phone and Messages)
  3. Open the iOS Messages app
  4. Open a communication thread
  5. Press and hold a SMS message
  6. Press "More..."
  7. Press "Report Messages"
  8. Press "Done" button when that button is available on GUI of the reporting extension
  9. Press "Cancel" button in the iOS Messages application after the GUI of the reporting extension is dismissed
  10. Repeat from step #5 with another SMS

Expected result:

  • There are 2 reports sent to the external server

Actual result

  • There is only one report sent to the external server (step #8)

I have filed a bug report FB9905746 in case anyone else experienced this problem too.

I would like to update some information:

STEPS TO REPRODUCE 
1. Install the app contains a Message Filter extension and an Unwanted Communication extension
2. Enable those 2 extensions in Settings (Phone and Messages)
3. Open the iOS Messages app
4. Receive a SMS from an unknown phone number A
5. Press and hold the SMS message received in step 4
6. Press "More..."
7. Press "Report Messages"
8. Press "Done" button when that button is available on GUI of the reporting extension
9. Press "Cancel" button in the iOS Messages application after the GUI of the reporting extension is dismissed
10. Receive a SMS from an unknown phone number B
11. Press and hold the SMS message received in step 10
12. Press "More..."
13. Press "Report Messages"
14. Press "Done" button when that button is available on GUI of the reporting extension
15. Press "Cancel" button in the iOS Messages application after the GUI of the reporting extension is dismissed

When check device log I see in the first try (step 8), the process MessageFilter appeared but not in the second try (step 14)

com.apple.IdentityLookup.MessageFilter	classification report request: <private>
...
com.apple.IdentityLookup.MessageFilter	Garbage collection for alternative services

Update 15:00 GMT+7 01-Mar-2022

I have tested on another iPhone 11 Pro Max but iOS 14.8.1:

  • I can send the 2nd report, the 3rd report... and so on without doing force close the iOS Messages application
  • But the GUI created by the Unwanted Communication Extension is not displayed immediately (5-6s delay)

Would you mind also adding a sysdiagnose to the bug report on iOS 14

Sorry, I don't have any iOS 14 device now to reproduce. I also required iOS 15 is the minimal OS version. Actually, after publishing the app to TestFlight and App Store, this issue didn't appear.

I am using iPhone 12 Pro with iOS 16.1.2 and facing the same issue. Is there any solution available?

I also tested using TestFlight and the issue still appeared.

Same issue as @alex_at_twofive25_dot_com and @CharlesTWM

Testing with iOS 16.5 failed, but iOS 14.8.1 was successful. The following are the differences I observed in the device logs.

iOS 14.8.1

com.apple.IdentityLookup.MessageFilter	Connection 13: connected successfully
com.apple.IdentityLookup.MessageFilter	Connection 13: TLS handshake complete
com.apple.IdentityLookup.MessageFilter	Connection 13: ready C(Y) E(Y)
com.apple.IdentityLookup.MessageFilter	Task <BD3610F1-17C9-408B-8BD9-36760810BC60>.<1> now using Connection 13
com.apple.IdentityLookup.MessageFilter	Connection 13: received viability advisory(Y)
com.apple.IdentityLookup.MessageFilter	Task <BD3610F1-17C9-408B-8BD9-36760810BC60>.<1> sent request, body S 810
com.apple.IdentityLookup.MessageFilter	Task <BD3610F1-17C9-408B-8BD9-36760810BC60>.<1> received response, status 200 content K
com.apple.IdentityLookup.MessageFilter	Task <BD3610F1-17C9-408B-8BD9-36760810BC60>.<1> done using Connection 13

iOS 16.5 (print log only at first time and receiving external server response)

com.apple.IdentityLookup.MessageFilter	Connection 1: connected successfully
com.apple.IdentityLookup.MessageFilter	got event: Connection invalid
com.apple.IdentityLookup.MessageFilter	Connection 1: TLS handshake complete
com.apple.IdentityLookup.MessageFilter	Connection 1: ready C(Y) E(Y)
com.apple.IdentityLookup.MessageFilter	[C1] event: client:connection_reused @0.160s
com.apple.IdentityLookup.MessageFilter	Task <8025DB62-2606-44F7-9502-1E68FCA8A5B0>.<1> now using Connection 1
com.apple.IdentityLookup.MessageFilter	Connection 1: received viability advisory(Y)
com.apple.IdentityLookup.MessageFilter	Task <8025DB62-2606-44F7-9502-1E68FCA8A5B0>.<1> sent request, body S 1766
com.apple.IdentityLookup.MessageFilter	Task <8025DB62-2606-44F7-9502-1E68FCA8A5B0>.<1> received response, status 200 content K
com.apple.IdentityLookup.MessageFilter	user sessions enabled, targeting 501
com.apple.IdentityLookup.MessageFilter	cleaning up unpooled xpc conn to trustd 0xc2290faa0
com.apple.IdentityLookup.MessageFilter	got event: Connection invalid
com.apple.IdentityLookup.MessageFilter	Initializing connection
com.apple.IdentityLookup.MessageFilter	Task <8025DB62-2606-44F7-9502-1E68FCA8A5B0>.<1> done using Connection 1

iOS 14.8.1 print following log in the end, but iOS 16.5 doesn't

com.apple.IdentityLookup.MessageFilter	Connection 13: done

How can I identify the root cause of the error message: "got event: Connection invalid"?

We have found the reason for the issue where API requests can only be sent once on iOS 15 and above!

This is related to the support for HTTP/3 and QUIC starting from iOS 15. We found that when the server's response header includes "alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000", it restricts the request to be sent only once.

Therefore, after disabling QUIC on our API server - Google Cloud Run, the API can be sent multiple times. I would like to know if this limitation is imposed by this extension, preventing the use of HTTP/3?

We also hope that this solution can help others facing the same issue, providing a temporary workaround for this problem.

WWDC21 - Accelerate networking with HTTP/3 and QUIC

The Unwanted Communication Reporting extension sends response over the network connection only ONCE after installing. Is it a bug?
 
 
Q