Weekly update for week #2 [17/6-23/6]

This is the end of my first week of GSoC. I am very happy that I have finished the tasks outlined in this week’s schedule fully. This is the first week of my two weeks in the implementation of the client side component of my error reporting module. So by next week we should be finished with the client side completely and start on the server side.

This week my tasks as per my schedule were:

“create the function that takes an exception and gets all the required info, then anonymizes it. A view is created with the relevant data asking the user to authorize the sending of the report to our servers.”

I have added a handler for the “window.onerror” which collects the necessary info and according to the user settings either sends the error report automatically or ignores it or asks the user what to do. If the user choses to see the error report a modal dialog is opened showing the content of the report as well as asking the user for the steps that lead to the error. Once the user accepts sending the error report the javascript instructs the server to send the error report to our servers.

There is a request being made to the error reporting server but that is not yet implemented so as of yet it should just fail silently. I made sure that all the strings in both the php part and the javascript part are translatable. I have made the javascript respond according to the user preferences like automatic sending or ignoring silently. I have collected a lot of relevant info about the error, however I have not anonymized anything. I did not see a part of the error report that may be considered private however my mentor may suggest a candidate for anonymization once he tries the feature.

For next week my task includes adding of try and catch statements to parts of code so as to get a stacktrace in some cases since this is not possible in “window.onerror”. Also I will try to tackle another problem which is that the line number that is retrieved either in the stacktrace or in “window.error” is for the entire concatenated file of javascripts. This is not very useful as it is not easily reproducible by the developers and is very vague in the sense it is not easy to figure out where this line number is.

When I was writing this report an idea came to me to solve the line number in the concatenated file problem. I can write a bash script that given the get_script.js.php request params and the line number it can output the file which has the relevant number and output the correct relative line number. This is still not very elegant and I will ask the phpmyadmin developers opinions in the mailing list soon.

As for adding try and catch to the functions I have decided that for starters I can wrap them around all functions starting with PMA_. My mentor also suggested I add “AJAX.registerOnload” callback to the list since it is important. I may also wrap other functions manually if I deem them important enough that a large part of the pages uses them or if they do a complicated enough task. but for now it is just the methods I have mentioned. The wrapping is done at run-time so that I will not modify the code of these functions so that this feature can be turned off easily.

I shall do a feature detection to see if a stacktrace is supported by the browser first before trying to wrap these functions in try and catch blocks since it may be useless if the browser doesnt support it. Another problem might be is that if I wait till the document is ready before I do the code wrapping any exception may not be caught by the try and catch blocks however if start too early then the javascript files may not be parsed and some of the functions may have not been defined yet. I still have to research how to do this and what is the best approach.

This is enough for the week. Today I am taking the rest of the day off for a personal matter and I shall start on next week’s tasks tomorrow


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s