FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
130 stars 26 forks source link

Enums are not correctly deserialized when being returned on an algolia search on iPhone and Android devices #3464

Open QuinnGunter opened 4 months ago

QuinnGunter commented 4 months ago

Can we access your project?

Current Behavior

when creating a listview that shows the results of an algolia search if one of the fields is an enum it is not being deserialized and i believe it is being returned as a String causing a null value in the ui.

This is resolved on web. However is still an issue on iphone and android physical devices

Expected Behavior

i expect to have the value properly valued as an enum on mobile devices as it is on web

Steps to Reproduce

  1. add a schema to firebase with a enum value in a field
  2. add algolia to the project
  3. add a listview that displays the results of an algolia search
  4. add some variable that is set to the enum field of the algolia search with a default value i chose ERROR
  5. run in test mode on android or ios
  6. search for an item and see the value in the listview

Reproducible from Blank

Bug Report Code (Required)

IT48lfLqw4VgoctF7r6Jc8Ewlj0vJl87U4E7jdYaZxU8J5zTP4YIP/v7ak5oO7ynT3NmJWGgrHEy/PfqifLDF8IqIRCuQYtxyqt2Wg/KJDuWVpCXEc2vfW1RHpthJlS/16ujmgp+VdJqdUY/22CQI96+dBXYHuP6Ino3IvmlKdeK2SrDX1iXc2URm05KZDPz

Visual documentation

Functional on web/ run issue on mobile test devices
https://github.com/user-attachments/assets/077ff2f5-016b-4325-abd1-bc6c580a4ab9 https://github.com/user-attachments/assets/d5b4b25d-4d71-4164-9e29-b42a9599f01b

Environment

- FlutterFlow version: Version 4.1.75 (4.1.75)
- Platform: Local test or physical device
- Browser name and version: na
- Operating system and version affected:  macOS 14.5 (23F79)

Additional Information

Same issue as here. Web and run modes work. However Ios and Android phones fail to display results. https://github.com/FlutterFlow/flutterflow-issues/issues/2756

QuinnGunter commented 4 months ago

@mohn93 @fabiofcos if you are interested in following along

Alezanello commented 4 months ago

Hello!

I tested it by creating a new event, and it shows up directly. However, when I try to search for it, there is an endless heart loader. This is very strange because no errors are showing in the console.

Do you have any logs from your side in Algolia regarding the search? Or have you tried using Algolia directly to search the documents?

Best regards,
Azanello

QuinnGunter commented 4 months ago

Hi @Alezanello I do not have the logs regarding the search. When I search in Algolia with the same search the results are returned as expected. Even using the Run mode on this project will give me results instead of the infinite loader

QuinnGunter commented 4 months ago

@Alezanello you'll find if you create an event with the "never" repeat option you will get the result to load when searched. Assuming that the search is unique to only the "never" repeat event.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

QuinnGunter commented 3 months ago

This issue is still present

QuinnGunter commented 3 months ago

@Alezanello Any update on this? This is a major issue in my production application. Users can not use the search do to this.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

QuinnGunter commented 3 months ago

This is still an issue for me

ryutosh commented 2 months ago

@Alezanello Still have problem in issue 3638 you closed as duplicate.

I tried to figure out the problem. Then, knew "getDocumentFromData" causes run time error "ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Fruits' is not a subtype of type 'String?".

SomeRecord.getDocumentFromData( { "favorite_fruit": Fruits.values.byName("orange"), // Fruits is enums. }, SomeRecord.collection.doc(docId)

quillifyai commented 2 months ago

I have the same problem of the enum not deserializing correctly, but my use case is when I put it in a text widget in a generated list. From what I can tell in the code, it needs to look like this: extension FFEnumListExtensions on Iterable { T? deserialize(String? value) => firstWhereOrNull((e) => e.serialize() == value?.replaceAll("${T.toString()}.", "")); //Added the replaceAll }

But I'll also note that while this method works in debug mode, it does not work in release mode

ryutosh commented 2 months ago

@Alezanello With all due respect, what is your roadmap for this issue? Sorry to ask such an intrusive question, but the suspension of the search function is fatal to the app.

I can't understand why it is labeled as “waiting for user response” even though other reports have been raised by other users.

MortadhaFadhlaoui commented 2 months ago

A quick workaround :

'format': convertAlgoliaParam( snapshot.data['format'], ParamType.Enum, false, ),

###############################

'format': snapshot.data['format'],

asifmasroor commented 3 weeks ago

I have the same issue and it's not resolving. @MortadhaFadhlaoui can you please explain where to update this code?

QuinnGunter commented 1 week ago

I'd love to hear if there is any update here? Issue is still present and doesn't seem to be a priority to get fixed. This issue completely blocks the use of the integrated search with Algolia.

asifmasroor commented 1 week ago

It seems like Flutterflow team is in sleep mode 📳

asifmasroor commented 1 week ago

This issue was reported on July 24th. Almost 4 months have passed without any resolution. I don't understand how a CRITICAL bug like this can be ignored for so LONG. As @QuinnGunter stated, this is a MISSION-CRITICAL bug and without resolution, no app can stay live.

quillifyai commented 1 week ago

I'm having the same persistent issue

QuinnGunter commented 1 week ago

@leighajarett any word if this is something that is on the roadmap to be fixed? I appreciate any insight you can give on this.

Alezanello commented 1 week ago

Hello everyone,

I sincerely apologize for the delay in my response. I missed track of this issue until today when I was alerted by the recent replies. I can confirm that this issue is occurring, and I will escalate it to the engineering team to work on a fix.

Thank you for your patience, and once again, I’m very sorry for the delay.

QuinnGunter commented 1 week ago

Thank you so much for the update ❤️

asifmasroor commented 6 days ago

@Alezanello Any timeline for the fix?

asifmasroor commented 4 days ago

@victoriahuang1 Any updates?? This is EXTREMELY critical. At least acknowledge that you or anyone in your team is working on it?

Hello everyone,

I sincerely apologize for the delay in my response. I missed track of this issue until today when I was alerted by the recent replies. I can confirm that this issue is occurring, and I will escalate it to the engineering team to work on a fix.

Thank you for your patience, and once again, I’m very sorry for the delay.