-
Notifications
You must be signed in to change notification settings - Fork 34
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
upload service rewrite #988
Comments
I went to test this on my test phones, to see what the flow of popups should look like, and could not find the feature. As it turns out, this is enabled by one of the variables in the config file, which is only I can see where this is a valuable tool for debugging from a user experiencing issues, but am struggling to run the existing flow in the emulator -- maybe having to do with |
@Abby-Wheelis I added this because people were having issues emailing the logs - if the log file is too large, then it cannot be attached in most email clients. There were also issues with people using non-default email apps (e.g. gmail on iOS) so that their default app was not even set up and could not email logs. However, it requires a new REST API on the server side (https://github.com/e-mission/em-bug-upload) to accept the logs, and I have not yet applied for cyber permission for that service, so we cannot host it in the NREL environment. So to test this, you do in fact have to:
If anybody wants to volunteer to do get cyber approval for the upload service so that we can re-enable this feature, I would be very supportive! |
That makes a lot of sense, I believe it would also then resolve the thought we were having about being able to email more than one day of logs (which we can't do right now because of size limitations). With the testing steps you've given, I can hopefully get it working locally, and therefore be able to test as I convert the service, so that we have it ready if/when we get approval and have the server side set up. |
I was able to get things working with the em-bug-upload locally, so moving forward with trying to rewrite and test.
|
As a status update (and reminder to my Monday self) -- the issue I was having with a hook out-of-place was because I was using |
Right now, I'm stuck on configuring the post request in a way that doesn't throw an error. From what I'm getting back from the debug server right now, the request is set up in such a way that the "reason" parameter is not properly found. The previous request is:
and the new request is looking something like:
but I continue to get errors about "reason" (one of the params) being undefined. I'll keep working at it, but I haven't been able to get past the error yet. I've been referring to docs on fetch and other information about passing information to the server here. |
I got a This isn't going to be perfect - we will definitely want to revisit the UI to restore a spinner, for example, but it will get us away from angular for now, and make sure the functionality is tested enough that we it won't be broken when we're ready to resurrect the functionality. |
I now have a working test for this as well as having it working in the emulator. I think the last thing I want to do on this pass is mock |
I mocked Something has gone wrong I believe with the way that I'm sending the |
I found this related issue: #609 which details the process from the first time this was implemented. It is clear that sending the I need to find a better way to send the file to the server, but I'm not really sure what that looks like right now. I tried briefly to read the whole I just tried reverting to only uploading the file, and hardcoded the file name - which worked to upload the contents, but of course lost the "reason" and the "timezone". This fetch request works to upload the contents, in their SQLite fornat.
Now, I just need to get the other data parameters back into the request, back out of it at the server, and make sure nothing in the tests broke! |
Reading through the previous thread again, and seeing that I did, however, notice that she used "url encoding" and worked (that's what the third parameter in the old post was, I did not realize). So next thing I'll try is embedding these params into the url myself, since fetch won't take a 3rd parameter. Hoping this restores functionality 🤞 |
Adding the url encoding manually worked! This is what I should have done in the first place, I just didn't realize it. The reason is now going through and being read, and I just need to include the timezone properly to fully restore function. |
Upload Service is now in React, working in the emulator, and has a test it passes. I had originally needed to alter the |
This was merged in PR #1053. The task is done for now, since this feature is not available on staging or production. In order to have this available, we will need to get cyber approval and can refer back to this issue at that time. |
Upload Service -- Child Issue of #977
One of the angular services that needs to be rewritten is uploadService.js.
This service has one exported function, used in one place
ProfileSettings
for uploading the logs. The other 5 functions are helpers foruploadFile
. However, this function is fairly complex, makes extensive use of promises, and has several instances ofionicPopup.show
andionicPopup.alert
that need to be replaced somehowThe text was updated successfully, but these errors were encountered: