SuperOffice / DevNet

Contains code samples shared with the community (https://community.superoffice.com/en/developer).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calling executeSoProtocol twice breaks client

mawax opened this issue · comments

If the method executeSoProtocol is executed twice without reloading the page the SuperOffice CRM web client breaks and will just show an empty background:
image

A work-around seems to be to call the refresh() method after every executeSoProtocol call

commented

I see by your screenshot that the connection to sod is "not secure". Are you by any chance using fiddler, MITM software or spoofing techniques to fake sod.superoffice.com? If so; When the browser thinks the connection is not secure, it will behave quite differently than in normal situations. May I ask you to verify that this is still an issue when not using MITM?

If you are not using any MITM software, then you probably have malware on your computer and/or network.

None of the above: my webpanel used an self-signed and not trusted ssl certificate which marks the whole page 'not secure'. To make sure this is not the issue I've fixed the certificate but the problem remains:

image

The problem does not occur by the sample in this repo but can be reproduced by changing the soprotocol from:
SuperOffice.ClientCrossMessaging.executeSoProtocol("contact.main?contact_id=10");

to:
SuperOffice.ClientCrossMessaging.executeSoProtocol("appointment.main? appointment_id=1&edit");

Then press the Execute soprotocol button twice without refreshing the page

SuperOffice.ClientCrossMessaging.executeSoProtocol("appointment.main? appointment_id=1&edit");

In your example there is a space between the ? and the protocol-parameters. Is this still a problem if you fix that?

Probably entered in the comment by accident but it's not in my code:
SuperOffice.ClientCrossMessaging.executeSoProtocol("appointment.main?appointment_id=1&edit");

Hi Matthijs,
We were able to reproduce this and will fix it asap. I can't guarantee it will make it this week, but the next release.

The fix will require, if opening a dialog, to include the text [dialog=stop] included in the soprotocol string.

Today you can avoid the problem by including a main panel name in the beginning. For example, "contact.www.appointment.main?appointment_id=1&edit" should work without the problem you have observed. This of course will flip the UI, if not already on the contact panel and www tab. So you have to know where you are and set the context accordingly.

This issue is now fixed in Online Development environment.

Example valid strings:
appointment[dialog=stop]?appointment_id=26
appointment[dialog=stop].main?appointment_id=26
appointment[dialog=stop].details?appointment_id=26
contact.www.testsoprotocol.appointment?appointment_id=26

Invalid strings:
appointment?appointment_id=26
appointment.main?appointment_id=26
appointment.main[dialog=stop]?appointment_id=26