Coder Social home page Coder Social logo

Comments (7)

bmourat avatar bmourat commented on May 12, 2024 1

Hey @ianbytchek
I've played with this a little and it seems like it is not the crashes module. If you call start with Analytics module, and i presume any other module, it will happen also. The reason is that while sendind start service log, sdk tries to determine screen size here. And after this call NSRunningApplication.current is assigned a new object. You can reproduce this by inserting call to NSScreen.main between print statements, like this:

Swift.print(NSRunningApplication.current.processIdentifier)
NSScreen.main
Swift.print(NSRunningApplication.current.processIdentifier)

from appcenter-sdk-apple.

iby avatar iby commented on May 12, 2024 1

Thanks for figuring this out! This is interesting! My curiosity is 💯 satisfied.

from appcenter-sdk-apple.

iby avatar iby commented on May 12, 2024

This is also observed when changing application type via ApplicationServices api, main.swift file below shows what happens. The same affect can be achieved with creating a copy of NSApplication, which does this internally.

// main.swift
import AppKit.NSRunningApplication
import ApplicationServices.HIServices

Swift.print(NSRunningApplication.current)
var psn: ProcessSerialNumber = .init(highLongOfPSN: 0, lowLongOfPSN: UInt32(kCurrentProcess))
TransformProcessType(&psn, UInt32(kProcessTransformToBackgroundApplication))
// _ = NSApplication() // Or just do this for the same effect…
Swift.print(NSRunningApplication.current)

AppCenter and PLCrashReporter don't appear to use the above api. What's the catch?

from appcenter-sdk-apple.

ElektrojungeAtWork avatar ElektrojungeAtWork commented on May 12, 2024

Hi @ianbytchek,
this is interesting. We need to look at this more closely.
Any chance you can send us a full stacktrace through support(intercom, the blue button on the App Center portal)?

from appcenter-sdk-apple.

iby avatar iby commented on May 12, 2024

There's no crash – if I understood you correctly about the stacktrace? What I'm saying is starting AppCenter with crashes changes the application type in some untraceable way. To check this behaviour simply create a console app and put this inside the main.swift:

Swift.print(NSRunningApplication.current) // <NSRunningApplication: 0x608000111040 ((null) - -1)>
MSAppCenter.start(MSAppCenter.identifier, withServices: [MSCrashes.self])
Swift.print(NSRunningApplication.current) // <NSRunningApplication: 0x6040001049b0 (com.my.app - 52214)>

I'd like to know how AppCenter does it without any obvious api calls.

from appcenter-sdk-apple.

ElektrojungeAtWork avatar ElektrojungeAtWork commented on May 12, 2024

Oooops, I somehow misunderstood your message here. Sorry.
I didn't find the time to check this last week, we'll get back in touch as soon as I know more. Making the process available might actually be unintentional but we need to check 😇

from appcenter-sdk-apple.

ElektrojungeAtWork avatar ElektrojungeAtWork commented on May 12, 2024

Hi @ianbytchek,

sorry for the long wait. I've meant to investigate but just didn't find the time. I've created a bug for this and we will triage it accordingly.

from appcenter-sdk-apple.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.