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

ConnectionDetails inconsistency all over application #25

Closed
shytikov opened this issue Feb 22, 2015 · 8 comments
Closed

ConnectionDetails inconsistency all over application #25

shytikov opened this issue Feb 22, 2015 · 8 comments

Comments

@shytikov
Copy link
Contributor

It seems to be there is no one consistent approach to ConnectionDetail handling in XrmToolBox application.

For example, on application start application reads information about available connections from configuration file. But when we opening first plugin, the system asks about connection to CRM and offers user to choose from the list of connection red from configuration file just now. So it reads file twice, and if it was changed, information is differs.

My scenario was following: I have copy of config files for my local CRM servers on virtual box (I use it at home), and config file with production servers. I don't want them to be mixed together in one file, since in office I'm not using virtual servers, so trying to connect to them I get an error, while at home I don't have access to my production servers, so I will get error connecting to them as well.
I started XrmToolBox, found that servers I want to work with are not in the list, so I overwritten one config file with another one, without restarting XrmToolBox.
As result I was able to connect to the server that not in the list of already loaded to XrmToolBox.

There is also strange behavior I cannot isolate for now: changes in connections list made in windows initiated from menu bar will not affect connections list that is called from status bar.

It also seems to be that connection information is updated in configuration file on program exit, while if it crashed due some reason, all changes will be lost.

Another thing that there is no event that fires when connection list is updated, thus if plugin works with the connection list it will not be notified about changes.

@MscrmTools
Copy link
Owner

A singleton should certainly be used to ensure only one access point for the connection file

@MscrmTools
Copy link
Owner

What about:

  • a singleton for ConnectionManager to ensure only one access point?
  • a SystemFileWatcher that will monitor connections file changes
  • an event handler in ConnectionManager to report files change

This way, each time a connection change (and the file is saved), every application that uses ConnectionManager class can be notified about a change.

I tested it with creating a ConnectionDetail on a tool launch, and then opening connection control on the bottom left. It seems to work

@shytikov
Copy link
Contributor Author

If it will work for you, I can offer you following approach: if you can push this code as separate branch to this repository and I will test it with all scenarios I have (luckily I'm working with all this connections functionality in VersionVerifier plugin).

And afterwards we can discuss results.

@MscrmTools
Copy link
Owner

Available on branch Issue25Branch

@shytikov
Copy link
Contributor Author

Thanks!!!

Overall basic scenarios works well, except one difference: create / edit connection dialog called from status bar has OK button disabled. While same dialog called from other places by default has OK button enabled. As result, called from status bar dialog requires verification of entered data, from other places verification is not needed.

@shytikov
Copy link
Contributor Author

There some issues in presentation list of connection:

When new connection is created from list of connection, the new entry added to the end of the list, when dialog closed and reopened new connection moves to the its place in alphabetical order.

In the status bar this issue is not applicable, since list of connections is visible only when status bar is clicked, so visually there new connection appears in right place right away.

@shytikov
Copy link
Contributor Author

I also can identify incorrect handling of custom password showed on edit connection form.

If password was saved (checkmark set), and then we changed our mind and unset the checkmark, the password stays in the edit window even after pressing OK button and re-opening this window. The information saved to the Connection Manager only after closing Connection List dialog.

This actually leads to very strange behavior:

  • I saved my password by mistake while I supposed not to do so;
  • I unset checkmark and pressed OK;
  • Reopened the connection from the list -- password is still there;
  • I tried to delete password -- the password field is empty;
  • I cannot close the window, since application complains about absence of password;
  • I stuck...

Definitely there is a way out — close Connection list and reopen it... But this is not the way how it should be done.

@shytikov
Copy link
Contributor Author

shytikov commented Mar 2, 2015

👍 Thank you!

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

No branches or pull requests

2 participants