Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to Add Data in Reports #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MuTaTeD
Copy link

@MuTaTeD MuTaTeD commented Dec 12, 2012

If you want the user to give a message regarding the previous crash, you can use the new utility method in CrashReportStore

If you want the user to give a message regarding the previous crash.

if(removeOldKey)
{
[report removeObjectForKey:@KSCrashField_UserAtCrash];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of removing the entire user dictionary, why not use -[NSDictionary mergedInto:] from NSDictionary+Merge?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I removed the old dictionary whether it is "User" or "UserAtCrash" and replace it with a UserAtCrash dictionary containing the previous as well as the new info...

What is your opinion as you know the system and architecture best.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that what this method is doing is actually replacing the user dictionary with a different one. To keep it in the spirit of its name (adding a custom key to the user data), it should add/replace the key inside the user dictionary rather than replacing the entire dictionary with a new one containing only that key.

Actually, this could be made even more useful if it were:

- (void) setObject:(id) object forKey:(NSString*) key inUserDataInCrashReportWithID:(NSString*) reportID

Where "object" is a JSON serializable type.
If the user data dictionary doesn't exist, it is created. If it does, the object gets added to it.
If the key doesn't exist, it is created. If it does exist, it is replaced.

Also, since "user" and "user at crash" variants get merged by KSCrashReportStore when you load a report, you don't even need to handle both in this code. Just stuff it in "user" and let the report store do the merging work later.

@muuuh
Copy link

muuuh commented Feb 6, 2014

It would be great, if the user could add additional information to a (previous) crash for a better understanding of the bug. Is this possible with email?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants