Outlookgooglecalendarsync: Word obfuscation not applied at all

Created on 18 Jul 2018  Â·  10Comments  Â·  Source: phw198/OutlookGoogleCalendarSync

OGcalsync_2740.log


OGCS Version: v2.7.4.0 (regression, bug not present in 2.7.0)
Installed or Portable: Portable

Problem Description
Word obfuscation is completely ignored, even though it is set and activated. The same rule that worked flawlessly in 2.7.0 doesn'w work at least in 2.7.4 and 2.7.5. I didn't test the versions in-between, but 2.7.0 is definitely in a good state.

Steps to Reproduce the Issue

  1. Activate word obfuscation
  2. Add the following obfuscation rule: Find ^.*$ Replace Booked time
  3. Save and start a sync

Expected result: All appointments have the title "Booked time" in Google Calendar

Actual result: All appointments have their original titles.

Any other information
You can see in the log file that word obfuscation is enabled. But in contrary to a log from v2.7.0 there is no sign whatsoever of the obfuscation being applied.

bug low resolved

Most helpful comment

:package: This should now be resolved with v2.7.5.2.zip (see instructions for applying).

Please let me know how it goes - maybe copy across your v2.7.0 settings.xml file again and see if the hotfix behaves better and it doesn't produce, eg:

    <Direction xmlns:d3p1="http://schemas.datacontract.org/2004/07/OutlookGoogleCalendarSync.Sync">
      <d3p1:Id>0</d3p1:Id>
      <d3p1:Name i:nil="true" />
    </Direction>

All 10 comments

Hi @Merlin2001
The only way I can reproduce this is:

  1. Set the Find and Replace rules - don't click out of the Replace text box
  2. Click Save
  3. Click Sync - this obfuscates correctly.
  4. Close and reopen OGCS
  5. The Replace field is empty
  6. A sync no longer ofuscates.

If you click out of the Replace text box before clicking Save however, it all works as expected. I'll look at getting a fix out...

Hi @phw198,

thanks a lot for looking into this! But I think the behavior you described is a different (and actually minor) bug. As you can see from my log file, the setting _is_ actually saved. The Replace field is not empty and still no obfuscation is done.

I just re-confirmed this in 2.7.5: Even when I click out of the Replace text box and save (and the log shows the right setting), there is no obfuscation done.

I don't know if this could influence word obfuscation in a weird way, but I'm behind a company proxy and use px as an in-between proxy to handle NTLM authentication.

If I can provide any more info to help you find the problem, please let me know!

(I looked at another log file of v2.7.5, and it contains no log lines like OutlookGoogleCalendarSync.Obfuscate [0] - Regex has matched and altered string: ^.*$ at all. In v2.7.0 these lines appear for every synced entry. I would attach it as well, but I'm not keen on manually replacing all appointment titles again ^_^.)

I now compiled the latest commit (https://github.com/phw198/OutlookGoogleCalendarSync/commit/79bc2e0e687ec3677626d8ba358dc130f55d210d) from source and word obfuscation worked fine. :confused: :question:

I think just found the probable reason for my problems: For some reason, the <Direction>
in the <Obfuscation> section of my settings.xml is very different from version to version.

In 2.7.0 it was simply:

    <Direction>
      <Id>1</Id>
      <Name>Outlook → Google</Name>
    </Direction>

The version I copied from my 2.7.4 folder to keep my settings had this strange variation:

    <Direction xmlns:d3p1="http://schemas.datacontract.org/2004/07/OutlookGoogleCalendarSync.Sync">
      <d3p1:Id>0</d3p1:Id>
      <d3p1:Name i:nil="true" />
    </Direction>

And when compiling from source I got this result:

    <Direction xmlns:d3p1="http://schemas.datacontract.org/2004/07/OutlookGoogleCalendarSync.Sync">
      <d3p1:Id>1</d3p1:Id>
      <d3p1:Name>Outlook → Google</d3p1:Name>
    </Direction>

Summary

Since I'm pretty sure (well, like 95% ^^) that I didn't alter the file manually, maybe there is a bug in storing the setting?

Edit

Upon fixing the settings.xml from above, I just noticed the same weird namespace definitions here

<SyncDirection xmlns:d2p1="http://schemas.datacontract.org/2004/07/OutlookGoogleCalendarSync.Sync">
    <d2p1:Id>1</d2p1:Id>
    <d2p1:Name>Outlook → Google</d2p1:Name>
  </SyncDirection>
  (...)
  <TargetCalendar xmlns:d2p1="http://schemas.datacontract.org/2004/07/OutlookGoogleCalendarSync.Sync">
    <d2p1:Id>0</d2p1:Id>
    <d2p1:Name i:nil="true" />
  </TargetCalendar>

After manually "fixing" the settings.xml in my 2.7.5 portable installation's folder, I still don't get word obfuscation to work. :cry:

Again, no calls to OutlookGoogleCalendarSync.Obfuscate in the log.

Are settings also persisted anywhere else?

I was going to ask you to post your SyncDirection XML sections to see what was happening, so good work for getting there before me.

So, in v2.7.0 the SyncDirection.cs class sat in the root of the project, but after that version I refactored it out to Direction.cs in folder Sync - see the namespace is OutlookGoogleCalendarSync.Sync?

What I hadn't appreciated was that the XML Serializer then specifies the namespace in the XML if the class namespace differs.

When you copied your v2.7.0 settings.xml file over for v2.7.4 it was missing the required namespace and so corrupted it: a SyncDirection of Id=0 and Name=null shouldn't be possible, but because it was it meant that this line was never true - so the regex never fired.

I think the solution for people wanting to migrate settings from <=v2.7.0 to >=2.7.5.1 will be changing line 6 in Direction.cs:

[DataContract(Namespace="http://schemas.datacontract.org/2004/07/OutlookGoogleCalendarSync")]

OGCS only uses settings.xml to store configuration. Check on the About tab to see where the config is coming from if you're still having problems?

:package: This should now be resolved with v2.7.5.2.zip (see instructions for applying).

Please let me know how it goes - maybe copy across your v2.7.0 settings.xml file again and see if the hotfix behaves better and it doesn't produce, eg:

    <Direction xmlns:d3p1="http://schemas.datacontract.org/2004/07/OutlookGoogleCalendarSync.Sync">
      <d3p1:Id>0</d3p1:Id>
      <d3p1:Name i:nil="true" />
    </Direction>

I just "installed" the hotfix version and copied my 2.7.0 settings and obfuscation works as expected!

Also, the only namespace declaration in the (intentionally saved) settings.xml is in the <Categories> element:

<Categories xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>[dontsync]</d2p1:string>
    <d2p1:string>Background</d2p1:string>
  </Categories>

Thus: Fix working as intended, issue can be closed :)

Thanks a ton for debugging this!

I have 3 instances of OGCS running in 3 different directories and the obfuscation keeps slipping sideways on one of them every couple of days. By sideways, I mean that it doesn't happen. I am using 2.7.5.2 (the hotfix)
Here's the most recent case I've been trying to fix for days. Basically I"m translating (.*)-->bibi on a one-way outlook to google sync

It was set and working fine. Then it wasn't. What stopped was obfuscation without me doing anything. I checked settings.xml (because the dialogs were all properly set) and found a flag that said to set obfuscation to false. I pasted in the "true" version of that setting from one of my other instances, and the log shows that being accepted. Nevertheless, no obfuscation happens, and the sync goes on copying the actual text rather than the obfuscation to the other calendar.

Can you help?
Thanks!


[OGcalsync.txt](https://github.com/phw198/OutlookGoogleCalendarSync/files/2299862/OGcalsync.txt)

@gelobter So in your Q:\OutlookSync\ieX\settings.xml file what does the Direction XML look like? Is it "clean" like this:

  <Obfuscation>
    <Direction>
      <Id>1</Id>
      <Name>Outlook → Google</Name>
    </Direction>
    <Enabled>true</Enabled>
    <FindReplace>
      <FindReplace>
        <find>(.*)</find>
        <replace>bi</replace>
      </FindReplace>
    </FindReplace>
  </Obfuscation>

BTW, are you sure that's the regex you want and not ^.*$?

here's what it looks like:

  <Obfuscation>
    <Direction>
      <Id>1</Id>
      <Name>Outlook → Google</Name>
    </Direction>
    <Enabled>true</Enabled>
    <FindReplace>
      <FindReplace>
        <find>(.*)</find>
        <replace>bi</replace>
      </FindReplace>
    </FindReplace>
  </Obfuscation>

BTW, I replaced everything in that directory and it's working again for now.

Was this page helpful?
0 / 5 - 0 ratings