Live data from Hacker News

App suddenly crashing on startup due to FBSDKRestrictiveDataFilterManager.m

github.com

391–400 of 446 posts

Re: App suddenly crashing on startup due to FBSDKRestrictiveDataFilterManager.m

#391
post #292

Earlier quoted context omitted.

There is more complexity in this. Proximate Issues The app makers cannot easily prevent the crash since it is happening in Facebook provided code. Perhaps the only thing they could do is to code in kill switches. Another possibility would be to modify the Facebook code. That introduces maintainability issues. The crash happened because of a server side change that triggered roughly the Objective-C equivalent of a nul…

> The crash happened because of a server side change that triggered roughly the Objective-C equivalent of a null pointer exception. > Objective-C is an old unsafe language. This was a safe crash, not an unsafe one. Swift can and would crash the same way.

You can’t safely call a method on a nil value in Swift. You need to explicitly force that in your code with an exclamation point to assume that the variable is not nil.

Looks like the server passed empty value in JSON which got converted to NSNull in Objective-C. It's a common mistake to assume null is returned instead of NSNull.

The Swift equivalent of the JSON library should return nil which you then need to explicitly check for non nilness before using unless you use the unsafe exclamation pint.

Re: App suddenly crashing on startup due to FBSDKRestrictiveDataFilterManager.m

#392

Earlier quoted context omitted.

Have you ever worked at a large company? Really the only thing that groups the whole thing together is the legal entity. Different teams within the same company are essentially different companies once you reach a certain scale. I see no reason to disparage the good work one group does, because of a different group of people they've never met before, for no other reason than they share a CEO. A CEO that neither group…

this is a pretty simple way to absolve people of responsibility. Just because an institution has compartmentalized tasks, so that every single individual team appears to do nothing wrong, doesn't mean this actually absolves individuals, because following that logic obviously nobody would ever be responsible for anything. It's like Kierkegaard's example of the mob who collectively intimidates but every member argues t…

>this is a pretty simple way to absolve people of responsibility.

Consider this menu of possible ways to be associated with a human rights violation:

- Do it yourself.

- Be a part of the chain of command that ordered it.

- Be commanded by the chain of command that ordered it.

- Be part of the same organization as the one that contains the chain of command that ordered it.

- Be a member of the society that contains the organization that contains the chain of command that ordered someone to do it.

- Be a member of another society, that could have tried to stop it, but didn't.

Where do we switch from participant to accomplice to bystander to "completely uninvolved?"

Re: App suddenly crashing on startup due to FBSDKRestrictiveDataFilterManager.m

#393

Earlier quoted context omitted.

Have you ever worked at a large company? Really the only thing that groups the whole thing together is the legal entity. Different teams within the same company are essentially different companies once you reach a certain scale. I see no reason to disparage the good work one group does, because of a different group of people they've never met before, for no other reason than they share a CEO. A CEO that neither group…

this is a pretty simple way to absolve people of responsibility. Just because an institution has compartmentalized tasks, so that every single individual team appears to do nothing wrong, doesn't mean this actually absolves individuals, because following that logic obviously nobody would ever be responsible for anything. It's like Kierkegaard's example of the mob who collectively intimidates but every member argues t…

Same could be said of an industry, and economy, or even a species. We are all part of systems at many different levels. Our critics might attempt to tie us to the bad parts of our systems and our proponents might seek to separate us from those same demerits. But I think either way of looking at it is just rhetorical.

Re: App suddenly crashing on startup due to FBSDKRestrictiveDataFilterManager.m

#394
post #391

Earlier quoted context omitted.

> The crash happened because of a server side change that triggered roughly the Objective-C equivalent of a null pointer exception. > Objective-C is an old unsafe language. This was a safe crash, not an unsafe one. Swift can and would crash the same way.

You can’t safely call a method on a nil value in Swift. You need to explicitly force that in your code with an exclamation point to assume that the variable is not nil. Looks like the server passed empty value in JSON which got converted to NSNull in Objective-C. It's a common mistake to assume null is returned instead of NSNull. The Swift equivalent of the JSON library should return nil which you then need to explic…

  $ swift
  Welcome to Apple Swift version 5.3 (swiftlang-1200.0.16.15 clang-1200.0.22.41).
  Type :help for assistance.
    1> import Foundation
    2> // IIRC this used to throw an exception.
    3> // Now a respondsToSelector: check is silently inserted and we get a surprise nil.
    4> (Int?.none as AnyObject).count + "call Swift's bluff".count
  Fatal error: Unexpectedly found nil while unwrapping an Optional value: file repl.swift, line 4
  2020-07-10 18:03:43.815959-0700 repl_swift[73029:930570] Fatal error: Unexpectedly found nil while unwrapping an Optional value: file repl.swift, line 4
  Execution interrupted. Enter code to recover and continue.
  Enter LLDB commands to investigate (type :help for assistance.)

Re: App suddenly crashing on startup due to FBSDKRestrictiveDataFilterManager.m

#396
post #391

Earlier quoted context omitted.

You can’t safely call a method on a nil value in Swift. You need to explicitly force that in your code with an exclamation point to assume that the variable is not nil. Looks like the server passed empty value in JSON which got converted to NSNull in Objective-C. It's a common mistake to assume null is returned instead of NSNull. The Swift equivalent of the JSON library should return nil which you then need to explic…

$ swift Welcome to Apple Swift version 5.3 (swiftlang-1200.0.16.15 clang-1200.0.22.41). Type :help for assistance. 1> import Foundation 2> // IIRC this used to throw an exception. 3> // Now a respondsToSelector: check is silently inserted and we get a surprise nil. 4> (Int?.none as AnyObject).count + "call Swift's bluff".count Fatal error: Unexpectedly found nil while unwrapping an Optional value: file repl.swift, li…

You need to call Swift's bluff with AnyObject. That's unsafe and was only necessary to bridge to Objective-C where you can call any method on any object.

I think we are in general agreement?

Re: App suddenly crashing on startup due to FBSDKRestrictiveDataFilterManager.m

#397
post #396

Earlier quoted context omitted.

$ swift Welcome to Apple Swift version 5.3 (swiftlang-1200.0.16.15 clang-1200.0.22.41). Type :help for assistance. 1> import Foundation 2> // IIRC this used to throw an exception. 3> // Now a respondsToSelector: check is silently inserted and we get a surprise nil. 4> (Int?.none as AnyObject).count + "call Swift's bluff".count Fatal error: Unexpectedly found nil while unwrapping an Optional value: file repl.swift, li…

You need to call Swift's bluff with AnyObject. That's unsafe and was only necessary to bridge to Objective-C where you can call any method on any object. I think we are in general agreement?

When you write an iOS app you're constantly interacting with Objective-C. The moment you're using JSONSerialization–and unless you're shipping your own JSON parser, you're not avoiding it–you're getting back a nice Any that you are almost certainly going to work with, possibly implicitly, using AnyObject. My point was that switching the SDK to use Swift would not help fix this issue, and I think I've shown that you'd run into similar issues even without the use of the force unwrap operator as you implied previously.

Re: App suddenly crashing on startup due to FBSDKRestrictiveDataFilterManager.m

#398
post #64

Waze, a google owned app for the past 4 years, crashes because of the FB app. WhatsApp, a Facebook owned app, will not give you read access to your own chat database - it’s encrypted. But they have an arrangement with Google where it’s will back up unencrypted to your Google account (though, Google won’t let you retrieve it ... only the WhatsApp app can) Everything about this duopoly, their cooperation and lack of co…

with all the daily (justified) outrage against FB/Google I struggle to understand why the community here is happy to applaud these companies for its innovation on specific projects or the work of specific engineers, ... whether it's project-zero or some fb framework we seem to be OK with praising their employees while at the same time hating how they use that innovation. some serious cognitive dissonace is going on -…

Maybe the people doing the lauding are different from those doing the criticizing? I'm inherently suspicious of statements which treat a discussion forum as monolithic.

Re: App suddenly crashing on startup due to FBSDKRestrictiveDataFilterManager.m

#399
post #396

Earlier quoted context omitted.

You need to call Swift's bluff with AnyObject. That's unsafe and was only necessary to bridge to Objective-C where you can call any method on any object. I think we are in general agreement?

When you write an iOS app you're constantly interacting with Objective-C. The moment you're using JSONSerialization–and unless you're shipping your own JSON parser, you're not avoiding it–you're getting back a nice Any that you are almost certainly going to work with, possibly implicitly, using AnyObject. My point was that switching the SDK to use Swift would not help fix this issue, and I think I've shown that you'd…

Fair enough.

Re: App suddenly crashing on startup due to FBSDKRestrictiveDataFilterManager.m

#400

Earlier quoted context omitted.

with all the daily (justified) outrage against FB/Google I struggle to understand why the community here is happy to applaud these companies for its innovation on specific projects or the work of specific engineers, ... whether it's project-zero or some fb framework we seem to be OK with praising their employees while at the same time hating how they use that innovation. some serious cognitive dissonace is going on -…

Maybe the people doing the lauding are different from those doing the criticizing? I'm inherently suspicious of statements which treat a discussion forum as monolithic.

If a company like Monsanto cured cancer, couldn’t you laud that effort even if you still disagree with other practices of the organization? Things, people, companies are rarely all good or all bad. We should applaud Facebook for their FOSS projects, while, for instance, pushing back against the walled garden and other data practices.
Post reply on HN