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

Display error messages for invalid trace type #231

Merged
merged 2 commits into from
Jan 25, 2021

Conversation

ankusht-work
Copy link
Contributor

fixes #187

Signed-off-by: Ankush Tyagi ankush.tyagi@ericsson.com

@ankusht-work
Copy link
Contributor Author

With this PR, the user will get a toast notification while trying to import an invalid trace. If the user attempts to import a directory that contains some invalid traces then, in that case, it will create an experiment with a set of valid traces (if any) and will be presented with a toast notification displaying all the invalid traces within that directory.

Screenshot:

Error_logging

Copy link
Collaborator

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for the contribution.

@bhufmann bhufmann requested a review from PatrickTasse January 20, 2021 18:40
}
// Display the names of all the incorrect traces.
if (Array.isArray(invalidTraces) && invalidTraces.length) {
this.messageService.error('Invalid trace(s): ' + invalidTraces.toString());
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this line appears both in the if and else clauses, can it be extracted outside of the condition block? Then perhaps the whole if block can be slightly simplified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. However, with the new proposed changes, this can't be extracted out :(.

@MatthewKhouzam
Copy link
Contributor

I want to be sure about this. from what I see, this will land us on the front page of /r/programminghumor as we have "trace loaded successfully" and "invalid trace" shown at the same time. Did I misunderstand?

@ankusht-work
Copy link
Contributor Author

I want to be sure about this. from what I see, this will land us on the front page of /r/programminghumor as we have "trace loaded successfully" and "invalid trace" shown at the same time. Did I misunderstand?

Nice catch :) Should we have a warning message instead? "trace loaded successfully and have a warning message displaying all the invalid trace(s). @mirsky-work @ebugden Thoughts?

@MatthewKhouzam
Copy link
Contributor

I want to be sure about this. from what I see, this will land us on the front page of /r/programminghumor as we have "trace loaded successfully" and "invalid trace" shown at the same time. Did I misunderstand?

Nice catch :) Should we have a warning message instead? "trace loaded successfully and have a warning message displaying all the invalid trace(s). @mirsky-work @ebugden Thoughts?

In my opinion we should have the same error message on the screen. The toaster by its nature is short-lived, and so it's not google friendly. On the screen where we have "your traces loaded fine", the user can then copy-paste the error and google/bing/duckduckgo the message.

@MatthewKhouzam
Copy link
Contributor

I want to be sure about this. from what I see, this will land us on the front page of /r/programminghumor as we have "trace loaded successfully" and "invalid trace" shown at the same time. Did I misunderstand?

Nice catch :) Should we have a warning message instead? "trace loaded successfully and have a warning message displaying all the invalid trace(s). @mirsky-work @ebugden Thoughts?

In my opinion we should have the same error message on the screen. The toaster by its nature is short-lived, and so it's not google friendly. On the screen where we have "your traces loaded fine", the user can then copy-paste the error and google/bing/duckduckgo the message.

After thinking about it:

The error message can be :
Some Traces failed to load

  • error 1
  • error 2
  • ....

@ankusht-work
Copy link
Contributor Author

I want to be sure about this. from what I see, this will land us on the front page of /r/programminghumor as we have "trace loaded successfully" and "invalid trace" shown at the same time. Did I misunderstand?

Nice catch :) Should we have a warning message instead? "trace loaded successfully and have a warning message displaying all the invalid trace(s). @mirsky-work @ebugden Thoughts?

In my opinion we should have the same error message on the screen. The toaster by its nature is short-lived, and so it's not google friendly. On the screen where we have "your traces loaded fine", the user can then copy-paste the error and google/bing/duckduckgo the message.

After thinking about it:

The error message can be :
Some Traces failed to load

  • error 1
  • error 2
  • ....

I want to be sure about this. from what I see, this will land us on the front page of /r/programminghumor as we have "trace loaded successfully" and "invalid trace" shown at the same time. Did I misunderstand?

Nice catch :) Should we have a warning message instead? "trace loaded successfully and have a warning message displaying all the invalid trace(s). @mirsky-work @ebugden Thoughts?

In my opinion we should have the same error message on the screen. The toaster by its nature is short-lived, and so it's not google friendly. On the screen where we have "your traces loaded fine", the user can then copy-paste the error and google/bing/duckduckgo the message.

After thinking about it:

The error message can be :
Some Traces failed to load

  • error 1
  • error 2
  • ....

I like your proposal but given the MVP deadline, I suggest an alternative solution.

  1. Show an error message in case all the imported traces are invalid.
  2. Show a warning message instead if 'any but not all' the traces are invalid and display the list of invalid traces in the toast message.

@ankusht-work
Copy link
Contributor Author

I want to be sure about this. from what I see, this will land us on the front page of /r/programminghumor as we have "trace loaded successfully" and "invalid trace" shown at the same time. Did I misunderstand?

Nice catch :) Should we have a warning message instead? "trace loaded successfully and have a warning message displaying all the invalid trace(s). @mirsky-work @ebugden Thoughts?

In my opinion we should have the same error message on the screen. The toaster by its nature is short-lived, and so it's not google friendly. On the screen where we have "your traces loaded fine", the user can then copy-paste the error and google/bing/duckduckgo the message.

After thinking about it:
The error message can be :
Some Traces failed to load

  • error 1
  • error 2
  • ....

I want to be sure about this. from what I see, this will land us on the front page of /r/programminghumor as we have "trace loaded successfully" and "invalid trace" shown at the same time. Did I misunderstand?

Nice catch :) Should we have a warning message instead? "trace loaded successfully and have a warning message displaying all the invalid trace(s). @mirsky-work @ebugden Thoughts?

In my opinion we should have the same error message on the screen. The toaster by its nature is short-lived, and so it's not google friendly. On the screen where we have "your traces loaded fine", the user can then copy-paste the error and google/bing/duckduckgo the message.

After thinking about it:
The error message can be :
Some Traces failed to load

  • error 1
  • error 2
  • ....

I like your proposal but given the MVP deadline, I suggest an alternative solution.

  1. Show an error message in case all the imported traces are invalid.
  2. Show a warning message instead if 'any but not all' the traces are invalid and display the list of invalid traces in the toast message.

I have made the changes as discussed. @MatthewKhouzam please verify.


if (traces === undefined || traces.length === 0) {
// All the traces are invalid. Display the error message and exit.
this.messageService.error('Invalid trace(s): ' + invalidTraces.toString());
Copy link
Contributor

Choose a reason for hiding this comment

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

When trying to import a folder that contains no metadata files, the message will say "Invalid trace(s): ", which is weird. In case of invalidTraces.length == 0 can we display something along the lines of "No valid traces found in the selected directory"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When trying to import a folder that contains no metadata files, the message will say "Invalid trace(s): ", which is weird. In case of invalidTraces.length == 0 can we display something along the lines of "No valid traces found in the selected directory"?

Good catch, I have added a check to see if the folder is empty (doesn't contain metadata files).

Note: There are other corner cases that we need to address, post MVP, for example (what happens if you upload a JSON file, txt file or other non-ctf traces.

Copy link
Contributor

@MatthewKhouzam MatthewKhouzam left a comment

Choose a reason for hiding this comment

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

My only issue is resolved. please handle Ilya's requests :)

fixes eclipse-cdt-cloud#187

Signed-off-by: Ankush Tyagi <ankush.tyagi@ericsson.com>
@bhufmann bhufmann merged commit f565daf into eclipse-cdt-cloud:master Jan 25, 2021
hriday-panchasara pushed a commit to hriday-panchasara/theia-trace-extension that referenced this pull request Nov 10, 2021
fixes eclipse-cdt-cloud#187

Signed-off-by: Ankush Tyagi <ankush.tyagi@ericsson.com>
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.

Display Invalid Trace message
4 participants