Archive for June 14, 2021

Monday, June 14, 2021

Concurrency in Swift 5 and 6: Data Races

Douglas Gregor:

An explicit goal of the concurrency effort for Swift 6 is to make safe-by-default also extend to data races. The type system and language model work together, through features like actors, Sendable, and global actors, to eliminate data races.

However, there is a lot of Swift code out there that was developed without the Swift concurrency model. Some portion of that code is going to have to change to fit within the constraints of Swift’s concurrency model, but it’s not going to be rewritten in a month or even a year. We need to consider what it’s going to look like to migrate the Swift ecosystem to Swift 6, and expect that this process will take years.


To enable the incremental rollout of Swift 6’s safe-by-default for data races, we’ll allow the use of concurrency features in Swift 5 with a “relaxed” enforcement model that allows incremental adoption[…]

See also: Swift by Sundell.


Swift Overloads That Differ Only in Async

Gwendal Roué:

I wish users could use the same method names in both synchronous and asynchronous contexts.


But I face “Invalid redeclaration” compiler errors, as expected according to the proposal.


Should I rename my async variants with some funny name? await asyncRead()? But the proposal itself wants to avoid C#’s pervasive Async suffix.


[The] new Core Data apis described in the WWDC21 conference Bring Core Data concurrency to Swift and SwiftUI face the same problem. They worked around the overload error by defining async methods with a different signature[…]

He found a workaround using the non-public @_disfavoredOverload attribute.

Ben Trumbull:

Methods in the same module cannot overload only on async-ness, but methods bridged from ObjC or in a different Swift module may.


Reporting App Store Scams

Tim Hardwick (Hacker News):

Apple has used its app review process as a bulwark in recent legal assaults on its App Store policy, and put particular emphasis on the security benefits for iOS users when buying apps. However, an investigation has found that almost 2% of the top 1,000 highest grossing apps on a given day were some sort of scam.

According to The Washington Post, which conducted the investigation, scam apps have been “hiding in plain sight” in Apple’s App Store, including several VPN apps that duped users into paying for software they didn’t need, a QR code reader that asked users for a $5 weekly subscription for a feature that’s already built into Apple’s native Camera app, and some apps that fraudulently appropriated the branding of Amazon and Samsung.

It would be interesting to know how that compares with the Google Play Store. Given that most of the revenue comes from a small fraction of the apps, you’d think that the highest grossing ones could be especially well vetted. Instead, as Kosta Eleftheriou has reported, looking at the top charts seems to be a good way of finding scams.

Apple (Reddit):

In addition, two updates have been made to the App Review contact form. If you appeal an app rejection, you can now specify if you believe your app was rejected due to unfair treatment (including political or other bias). And you can now report an app if you believe it presents a trust or safety concern, or is in violation of the App Store Review Guidelines.

Francisco Tolmasky:

Imagine if a city that bragged about having the best police force on Earth waited 14 years before begrudgingly agreeing to set up a 911 line so that citizens could actually call the police

Tanner Bennett:

Users still cannot report apps though. Gotta cough up $100 to contact the app review team here.

Francisco Tolmasky:

Does this make Apple the first company to implement a reverse bug bounty, where you have to PAY to report vulnerabilities?


Amazon Ships $7,000 Empty Camera Box

Jaron Schneider (via Hacker News):

A photography duo from Alamosa, Colorado recently ordered a Sony Alpha 1 camera from Amazon as an investment in their business in a transaction that they report cost them more than $7,000. But instead of receiving the new camera, the two only found empty boxes.


Worse, Chiles found that Amazon insisted that the package had been properly delivered, verified, and refused to issue him a refund. When speaking to an Amazon representative, his problems were dismissed.


Chiles says that he and his wife have proof that the package was not correctly delivered, as the UPS tracking label lists the weight of the box as just two pounds. The Sony Alpha 1 box weighs 3.22 pounds according to official listings[…]

Apparently, this was shipped directly from Amazon, not a Marketplace seller.


My recommendation is to skip Amazon for anything expensive or at high risk of shipper theft/fraud. Your customer experience will not be the same as when they lose a $10 package. They will treat you like a criminal no matter what your past history with Amazon is.


As others have also said, doing a chargeback risks Amazon closing your account permanently.

So if you’re prepared to take that risk and never buy from Amazon again, sure.. go for it..

But given the centralization of vendors this can have bigger downsides than upside.