Briefcases bug with DA Cached Calculated Fields

Firstly, it would be very useful if someone spent some time going through all the samples provided with a build to make sure they work. I have tracked down an issue and it would have been considerably faster if the PCTradeClient sample worked with the latest RO stuff. I have attached the one I ended up with but there are various things that need to be done to make it work which may be tricky for someone new to this. Things like having to add security/libxml references, edit the storyboards to build with latest Xcode, add NSAppTransportSecurity to info.plist, some graphics files are missing and make it actually run on a iPad (I never got this to work - I was trying to get it working on the iPad initially since that’s what my app is then found it is OK on the iPhone app so haven’t actually looked at this). Anyway, I digress…

The problem I have is this. I’m adding some calculated fields and caching them to speed things up for the user (as little changes on the table I do this). The definition (https://docs.dataabstract.com/API/Cocoa/Classes/DACachedCalculatedFieldDefinition/#q=addCalculatedFieldName) says that these are not saved to a briefcase but there is a problem because it seems they are and it corrupts the briefcase and it will not load next time it is needed. It also cannot be opened in server explorer. I’m edited the sample as attached to save the briefcase after the fields are setup and changed one of the fields to be cached so to see the problem, run the sample once until you see the clients view controller, then run it again and it will fail to load the briefcase. If you look at the briefcase in a text editor you can see it is added:


PCTrade Sample.zip (394.4 KB)

Thanks, logged as bugs://83814 (Briefcase bug)

Thanks, logged as bugs://83815 (Samples)

Curious:

~> {<DADataTable OrderDetails>
~>   <DAFieldDefinition OrderDetails.Id, 0x600003f638d0 PK>
~>   <DAFieldDefinition OrderDetails.Order, 0x600003f63a50>
~>   <DAFieldDefinition OrderDetails.Product, 0x600003f63bd0>
~>   <DAFieldDefinition OrderDetails.Amount, 0x600003f63d50>
~>   <DAFieldDefinition OrderDetails.Price, 0x600003f63ed0>
~>   <DAFieldDefinition OrderDetails.___calculatedField_OrderDetailSum, 0x600003f79ef0>
~>   <DAFieldDefinition OrderDetails.___calculatedFieldVersion_OrderDetailSum, 0x600003f79f80>
~>   <DACachedCalculatedFieldDefinition OrderDetails.OrderDetailSum, 0x60000155c840>}

these cache fields are of the wrong type, indeed. Wondering if this could have anything to do with it: :joy:

- (DAInternalFieldDefinition *) addInternalFieldWithName:(NSString *)fieldName {
    return (DAInternalFieldDefinition *)[self _addFieldWithName:fieldName isInternalField:NO];
}

Can you rebuild DA locally? if so, try changing that to YES should fix the issue (DADataTable.m, line 251). I’ll fix for next build and retest myself, as well.

I’m probably going to struggle today as I’m away for a week from this evening and there’s a few things I need to get done so I’m happy to await the next build thank you. I will endeavour to do it if I can. Incidentally, I don’t think this is a new issue - I think it’s been there a while.

A new build is up on the firehose that you could use, as well

Yeah, this probably never worked, and no-one ever used the combo of cached calculated fields, and briefcases ;). Which is odd, coz I used cached calculated fields quite extensively in our (now long defunct) internal “Bugs 7” application — which ay the time was the internal poster child for DA/Xcode use. Strange.

Any idea which build this may be in? I’ve been off, and just come back to this, and I see it isn’t in the latest DA (.1467) and tried a couple of firehose builds but can’t see it and am really not sure how to rebuild DA locally.

Also, the latest DA build fails with “Could not find .fx file “libxml” referenced from “libDataAbstract.fx”” when I build my project.

This should be in .1467, as well as in the build I did for you back when we last talked, 10 days ago.

Ah, so it is thanks, I see the change in the source code, just not in the change log! I can’t test it though due to the libxml error above (that’s the Fire plugin I tried). Bit of a delay getting back to things as ended up in hospital again this week ! OK now.

1 Like

it’s there:

  • DAX: Internal fields were not marked internal, screwing with briefcases that contained cached calculated fields

just add a reference to libxml2.fx. But that too should have been fixed and now be implicit…

I already have that.

Jeremy

Hmm. can I see a full detailed rebuild log?

Sorry, missed it, I was looking for the Bug ID referred to above and missed it at the bottom for some reason.

Sure. debuglog.txt (32.3 KB)

It builds OK with .1463.

bugs://83814 got closed with status fixed.

Oops, looks like forgot I had logged this, when I commuted the fix :wink:

will check.

Curious:

                    Reference 'libxml2' was resolved to '/Applications/Fire.app/Contents/Resources/Reference Paths/Toffee/../../References/Toffee/iOS/libxml2.fx' via XML for target 'Toffee-iOS'.
                     Reference 'libxml2' was resolved to '/Applications/Fire.app/Contents/Resources/Reference Paths/Toffee/../../References/Toffee/iOS/libxml2.fx' for target 'Toffee-iOS' (Device).
                     Reference 'libxml2' was resolved to '/Applications/Fire.app/Contents/Resources/Reference Paths/Toffee/../../References/Toffee/iOS Simulator/libxml2.fx' for target 'Toffee-iOS' (Simulator).
 ...
                Reference: /Applications/Fire.app/Contents/Resources/Reference Paths/Toffee/../../References/Toffee/iOS/libsqlite3.fx
                  Reference: /Applications/Fire.app/Contents/Resources/Reference Paths/Toffee/../../References/Toffee/iOS/libToffee.fx
                  Reference: /Applications/Fire.app/Contents/Resources/Reference Paths/Toffee/../../References/Toffee/iOS/libxml2.fx
                  Reference: /Applications/Fire.app/Contents/Resources/Toffee SDKs/iOS 13.2/AudioToolbox.fx
                  Reference: /Applications/Fire.app/Contents/Resources/Toffee SDKs/iOS 13.2/AVFoundation.AVFAudio.fx
                  Reference: /Applications/Fire.app/Contents/Resources/Toffee SDKs/iOS 13.2/AVFoundation.fx
                  Reference: /Applications/Fire.app/Contents/Resources/Toffee SDKs/iOS 13.2/CoreGraphics.fx
                  Reference: /Applications/Fire.app/Contents/Resources/Toffee SDKs/iOS 13.2/CoreLocation.fx
                  Reference: /Applications/Fire.app/Contents/Resources/Toffee SDKs/iOS 13.2/Foundation.fx
                  Reference: /Applications/Fire.app/Contents/Resources/Toffee SDKs/iOS 13.2/rtl-12.0.fx
                  Reference: /Applications/Fire.app/Contents/Resources/Toffee SDKs/iOS 13.2/Security.fx
                  Reference: /Applications/Fire.app/Contents/Resources/Toffee SDKs/iOS 13.2/SystemConfiguration.fx
                  Reference: /Applications/Fire.app/Contents/Resources/Toffee SDKs/iOS 13.2/UIKit.fx
                  Reference: /Users/Jeremy/Library/Application Support/RemObjects Software/Elements/Fire/Plugins/Remoting SDK.firepluginfolder/Toffee/iOS/libDataAbstract.fx
                  Reference: /Applications/Fire.app/Contents/Resources/Toffee SDKs/iOS 13.2/CoreFoundation.fx (implicit)
E:                Could not find .fx file "libxml" referenced from "libDataAbstract.fx"

that looks like a compiler bug. does this reproduce for you with any DA/Cocoa project?

nevermind, think I know what the problem is; libxml in the import vs libxml2 as the real name. fixed and started a new build for you.

No probs, this is a project in the office (I nipped over there to grab the log as I’m not in there again until next Friday), I’ve got no issues in my other projects which are on my home mac (they all use DA).

1 Like

I’ve tried a couple of times, to no avail, I just grabbed the latest fire plugin from firehose that I could see (.1468 dated 10th Feb) and am using the latest Fire (.2483) and this problem is still there, and is on any of my DA projects. If I revert to the latest stable DA then all works (other than the original cached field issue of course).

Curious; I doble-checked - I committed the fix on February 1.

<ImportFxDependencies>Security;libxml2</ImportFxDependencies>

instead of

<ImportFxDependencies>Security;libxml</ImportFxDependencies>

You’re referencing a DA.fx dated later than that, bit it still asks for a non-existent libxml? Can you send me the exact .fx file you’re building agains, and a complete rebuild/diagnostic build log? thanx!