Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Ionic app service response mapping is showing "Too Many Errors (38% scanned)" and not mapping data correctly.

Service response mapping is showing "Too Many Errors (38% scanned)" and not mapping data correctly. My service response has no custom code and is just mapped from the response data to $scope vars(Modals) with matching types. The response is giving values to all of the mapped variables but the values are incorrect. The response is somewhat long, could that be the issue?

I compare the service response with the final results like this:

$scope.user = user_scope;
console.log("Service Response 1 = "+JSON.stringify(success.data.data.toProfile));
console.log("Service Response 2 = "+JSON.stringify($scope.user.location_data));

The values are different when compared. I have shared the app with Appery. It's call EB. The page is Login_Registration and the $scope function is login(). To test, click the top right icon and login with user: a href="mailto:matt@matt.com" rel="nofollow"matt@matt.com/a pass: 1234
The console.log will show up after that.

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Ionic app service response mapping is showing "Too Many Errors (38% scanned)" and not mapping data correctly.

It does somehow seem to be linked to the service response length. I can reduce the overall amount of lines in the $scope function and the Error warning will go away. The more lines that I delete, even if they're empty, will cause the % scanned amount to increase until it finally goes away. Are we limited on how many lines there can be in a scope function? I currently have 122 lines total and must reduce it to about 106 lines in order for the warning to go away and the code after the warning to be executed.

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Ionic app service response mapping is showing "Too Many Errors (38% scanned)" and not mapping data correctly.

So here is an example of what's happening to the data and it seems to make no sense.
code
$scope.user.location_data.tuesday.openTime = success.data.data.toProfile.tuesdayOpen;
console.log("tuesday success = "+success.data.data.toProfile.tuesdayOpen);
console.log("tuesday user 1 = "+$scope.user.location_data.tuesday.openTime);
$scope.user.location_data.thursday.openTime = success.data.data.toProfile.thursdayOpen;
console.log("tuesday user 2 = "+$scope.user.location_data.tuesday.openTime);

/code
The openTime db values for tuesday is 700 and thursday is 800

The Console logs look like this:
tuesday success = 700
tuesday user 1 = 700
tuesday user 2 = 800

Somehow saving data to the $scope.user.location_data.monday.openTime changes the value of the $scope.user.location_data.thursday.openTime

When I console log out my $scope.user at the end of the success callback, it shows that the openTime for every day of the week has been converted to 800. This applies to the closeTime var as well.

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Ionic app service response mapping is showing "Too Many Errors (38% scanned)" and not mapping data correctly.

OK, I was able to get rid of the error by splitting up the Success callback into two functions. The main issue that I still have is that storing a value to one variable somehow changes another one.
So here is an example of what's happening to the data and it seems to make no sense but maybe I just don't understand Models correctly.

$scope.user.location_data.tuesday.openTime = success.data.data.toProfile.tuesdayOpen;
console.log("tuesday success = "+success.data.data.toProfile.tuesdayOpen);
console.log("tuesday user 1 = "+$scope.user.location_data.tuesday.openTime);
$scope.user.location_data.thursday.openTime = success.data.data.toProfile.thursdayOpen;
console.log("tuesday user 2 = "+$scope.user.location_data.tuesday.openTime);

The openTime db value for tuesday is 700 and thursday is 800

The Console logs look like this:
tuesday success = 700
tuesday user 1 = 700
tuesday user 2 = 800

Somehow saving data to the $scope.user.location_data.thursday.openTime changes the value of the $scope.user.location_data.tuesday.openTime

When I console log out my $scope.user at the end of the success callback, it shows that the openTime for every day of the week has been converted to 800. This applies to similar models that use the same last variable name. Such as:
$scope.user.location_data.tuesday.lunchTime
$scope.user.location_data.thursday.lunchTime

if I store a value to one of them, all the others get the same value stored to them as well.(monday, tuesday, wednesday etc).

Does this make any sense?

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Ionic app service response mapping is showing "Too Many Errors (38% scanned)" and not mapping data correctly.

I got it working. I had to change the user model to not have nested models.

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Ionic app service response mapping is showing "Too Many Errors (38% scanned)" and not mapping data correctly.

Hi, so I keep getting the "Too Many Errors" message whenever a service gets too long. This is fine for a service response because I can break the response up into multiple functions to make the function smaller. I have a problem with it giving this error when the request data is too long. About 100 lines in length. I also get this error in other functions when they get too long and have to be split up. Is this normal?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Ionic app service response mapping is showing "Too Many Errors (38% scanned)" and not mapping data correctly.

Could you please provide us with more details, screenshots or exact steps to reproduce this problem?

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Ionic app service response mapping is showing "Too Many Errors (38% scanned)" and not mapping data correctly.

Image
Image
Image

So this is one example out of a few. It's a basic server code service generated from Appery when I drag the service to the page and then do all of my mapping. On line 100 there is a yellow Caution symbol, when I hover over it, it currently says, "Too many errors. (88% Scanned)". I get this type of error message in a lot of Ionic scope functions that get to be over 100 lines of code. It doesn't matter if the function has a service in it or not. I thought that it was maybe due to mixed tabs and spaces errors so I fixed spacing in Sublime text and replaced to see if it changed the error and it didn't.
Is this something that I can/should just ignore without it causing problems?
Thanks for the help.

Return to “Issues”