Server-connect based parent-child repeats breaks when using variables across the two levels

Wappler Version : 2.5.1
Operating System : Mac OSX Mojave v10.14.5

Dear all,

I have attached the page & the server action file (uses public api sample data) for the below bug report.

Archive.zip (2.5 KB)

Details

I have a server-connect data (myJSON) that has two-level of parent-child data (department & employees) and is rendered using parent-child repeats (screenshot below).

Structure: {department: {name, employee: {name, year, salary} } }

I have two variables on employee-level that holds the salaries of 2019 & 2020 for each employee. And this is used on department-level to show the total salary of the respective years using this formula:

"var_total_salary_2019" = "child.items.sum("var_2019_salary.value").default(0)"

This works perfectly when loading the page… until… I have button when clicked, reloads the my server-connect with amended data. When reloaded, looks like everything is broken in the repeats.

When I look at the dmx.app.data after reload:

  • I see that only the parent-level repeat has loaded only the data
  • The two variables on parent-level repeat hasn’t loaded (not visible)
  • Child-level repeats and the two variables within it hasn’t loaded (not visible)
    .

I assume this is a bug as it’s logically not working to my eyes. Any help would be greatly appreciated, have been a great blocker. Thanks in advance.

I have also tried printing the parent-level data after the child data has loaded (like below) to see if it’s a DOM loading sequence issue, didn’t help, same issue persists.

This has been fixed in Wappler 2.5.2

1 Like

Just updated to 2.5.2 @Teodor, tested but it’s not fixed at my end.

Was dmxAppConnect.js updated?

After updating wappler, mine is still in version 1.7.5 (this file was provided by patrick in this thread - Using App Connect with JavaScript Functions).

May be I have to manually update this file to override the previous manual one? Can you share, thanks.

/*!
DMXzone App Connect
Version: 1.7.5
© 2020 DMXzone.com
@build 2020-01-24 12:46:50
*/

The fix is in the formatter js file.

My dmxFormatter.js didn’t get updated. It’s still dated 2019

/*!
DMXzone Formatter
Version: 1.1.8
© 2019 DMXzone.com
@build 2019-08-19 14:54:15
*/

New version for app connect is 1.8.0 and formatter should be 1.2.1

Try removing the js files and then save the page using them, it should copy the new versions then.

Thanks, your suggestion worked. It did fix this specific issue in the above test files that I prepared to reproduce this issue.

But, in my main app, something else might have got broken. My page is not loading anymore, and throwing this new error now.

The error comes somewhere from your server action.
Are you trying to use a default formatter somewhere, as the error points to a non-existing one - probably you entered somewhere defaults instead of default ?

My sincere apologies, it was me! Just fixed it at my end…

Thanks very much for the quick turnaround :slight_smile: I can confirm that the issue is fixed and it works like a charm. Thanks again amazing @patrick.

2 Likes

Thank you too for the great complex case of App Connect usage! It helped us track the bug and also shows the great power of App Connect!

1 Like

This topic was automatically closed after 2 days. New replies are no longer allowed.