Code Monkey home page Code Monkey logo

Comments (19)

janeylicious avatar janeylicious commented on June 12, 2024

I'm having the same problem and spent a couple minutes deleting things and testing different accounts. It looks like it only crashes for me with accounts using app specific passwords (i.e. 2fa enabled) as I have two with 2fa and two without and it's consistent on the one machine I'm having this problem with. (I thought that #26 might be related but I see console spam without crashes, so probably just a coincidence in terms of timing.)

from mail-notifr.

lookfirst avatar lookfirst commented on June 12, 2024

I also have 2fa enabled, so maybe that is it? It was working ok for a while though.

from mail-notifr.

ashchan avatar ashchan commented on June 12, 2024

Guys if it's truly 2fa related then we're likely to reproduce this.

Any chance you would debug it in Xcode? If not I'll have to setup an account with 2fa enabled and try to reproduce the issue.

from mail-notifr.

janeylicious avatar janeylicious commented on June 12, 2024

Just wanted to drop a quick note before you look into 2fa: I think that was an unrelated coincidence, that's what I get for trying to find an easy workaround instead of actually debugging last night :)

I thought it was a heisenbug when I built and ran from source without a problem and the MAS version ran without a problem too a couple minutes ago. But I decided to check and backtracked to my inbox state last night when the crashing started and it definitely crashes on at least one Google+ "x added you" email and possibly a similar one that arrived a short while later in the other account (and no such emails in my non-2fa accounts). Not sure why I couldn't repro on my laptop last night if that's what's going on, but there's one (better) place to start looking and I'll try to debug if I have some time later today.

from mail-notifr.

lookfirst avatar lookfirst commented on June 12, 2024

I'd be happy to try to debug it in xcode, but I'm not familiar with doing so. If you give me a bit of direction, I can certainly follow it.

from mail-notifr.

ashchan avatar ashchan commented on June 12, 2024

@janeylicious Thanks for this info Jane. In worst case it could be a bug in code that needs to be fixed.

@lookfirst Since the traceback shows your version is 0.9.0, below is how to run that version locally in Xcode (you need to have CocoaPods installed):

In Terminal:

gem install cocoapods (or sudo gem install cocoapods)
git clone --recursive https://github.com/ashchan/gmail-notifr-objc.git
cd gmail-notifr-objc
git checkout v0.9.0
pod install

When above is done, go to gmailn-notifr-objc folder, find a file named 'Gmail Notifr.Gmail Notifr.xcworkspace' and click it. Xcode will open it.

In Xcode use 'CMD+R' to start running and debugging the app. It will reads your accounts in your current Gmail Notifr installation. Please choose allow when keychain asks for permission.

Now if it crashes, a detailed traceback will show in debug area (use menu View - Debug Area - Show Debug Area to show it if it's hidden).

If Xcode complains it cannot build it, just stop there. Xcode updates very frequently some versions might not be working anymore.

Thank you very much!

from mail-notifr.

lookfirst avatar lookfirst commented on June 12, 2024

Thanks for great directions. Followed them and it didn't crash. I then ran the original version that I have on my mac and it works too. So, my guess is that the subject line of an email was causing the issue?

from mail-notifr.

ashchan avatar ashchan commented on June 12, 2024

@lookfirst Thanks! I updated the comment correcting the tag name.

If it's subject line related, we'll be able to reproduce the issue by marking that email as unread in Gmail, then relaunch Gmail Notifr again.

from mail-notifr.

lookfirst avatar lookfirst commented on June 12, 2024

Yea, I have no idea which email it was that caused the issue though. ;-) Maybe look to add a bit more defensive programming around that block of code?

from mail-notifr.

lookfirst avatar lookfirst commented on June 12, 2024

From the stack trace...

grep -r "dictionaryWithObjects" *
Binary file Libs/Growl.framework/Growl matches
Binary file Libs/Growl.framework/Versions/A/Growl matches
Binary file Libs/Growl.framework/Versions/Current/Growl matches

I don't actually have Growl enabled for both accounts though.

from mail-notifr.

ashchan avatar ashchan commented on June 12, 2024

Yes, I believe if any value is nil then this dictionary construction throws exception:

https://github.com/ashchan/gmail-notifr-objc/blob/master/Classes/GNChecker.m#L233

from mail-notifr.

janeylicious avatar janeylicious commented on June 12, 2024

Okay, I figured it out. I also thought I pasted the particular XML causing problems in my previous comment, but guess I was in a rush and thought @lookfirst might do that.

On Google's end, the actual time and date on the emails (which on the second account had narrowed down to multiple emails) were something along the lines of

<issued>2014-03-09T02:30:00Z</issued>

and I was really confused as to why NSDateFormatter dateFromString: returned nil only for these timestamps. Subsequently after a little testing, it turns out anything between 2:00:00 and 2:59:59 will and I realized that I forgot to account for DST and that 2 to 2:59am does not exist on March 9, 2014 in the US as a result.

So it's one hell of an edge case (I see you have another one involving the time too, not sure if google returns 0-23 or 1-24 or 0-24 (lol)) and I don't know how you want to deal with that so I don't have a pull request for you, but there you go. 😄

from mail-notifr.

ashchan avatar ashchan commented on June 12, 2024

@janeylicious You make our day! I don't think I'll ever figure this out without your help.

Timestamps are difficult to parse. Instead of trying to deal with all edge cases (who knows what other time ranges will cause issue like this), I guess I'll just take care of the nil value by inserting a time.

from mail-notifr.

lookfirst avatar lookfirst commented on June 12, 2024

Not sure why you are parsing it yourself? There should be some objc library for doing that.

http://stackoverflow.com/questions/2201216/is-there-a-simple-way-of-converting-an-iso8601-timestamp-to-a-formatted-nsdate

from mail-notifr.

janeylicious avatar janeylicious commented on June 12, 2024

@lookfirst that's what's being used right now at https://github.com/ashchan/gmail-notifr-objc/blob/master/Classes/GNChecker.m#L194, and NSDateFormatter with the currently defined locale doesn't like the timestamp being returned by Google (which would be okay in other locales).

Timestamps are definitely annoying to deal with in general though.

from mail-notifr.

lookfirst avatar lookfirst commented on June 12, 2024

I'm a java guy... we are lucky with joda time which handles all this stuff with ease. ;-)

from mail-notifr.

ashchan avatar ashchan commented on June 12, 2024

@lookfirst, @janeylicious

I made a quick dirty fix in df2a447. Please see if this fixes the issue.

What it did is returning an NSDate (1 hour before current time) if parsed date is NULL. Better return a valid but wrong date than nil which causes dictionary insert error.

As I didn't plan to upgrade the none app store version, if you guys are with 0.9.0 please let me know I'll send you redeem code for the store version.

Thanks!

from mail-notifr.

lookfirst avatar lookfirst commented on June 12, 2024

Thanks. I just bought the paid version, so hopefully there will be an update there soon. I have no problem supporting your hard work. ;-)

from mail-notifr.

ashchan avatar ashchan commented on June 12, 2024

@lookfirst I really appreciate your support. I'm going to add support for global 'Check All' shortcut in the weekend. So if everything goes smoothly I'll be able to submit a new version next week.

from mail-notifr.

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.