A field filled by a callback function behaves differently once published

Which tool versions are you using?

SDK: v14.11.0
Platform: v24.06.6
Python: v3.12.3
Isolation mode: venv

Current Behavior

A field that was filled properly in the ‘Development’ workspace thanks to a callback function is now empty at all times once the app is published.

Expected Behavior

I should behave like it does when started in the ‘Development’ workspace with a terminal call to viktor-cli start.

I fill a field with IDs separated by a comma in a first Step :
image
(I used the same for both the Development workspace and the one for the published app and tried others input aswell).

This is what i get in the Development workspace :
image

And in the published version workspace :
image

Thanks for your attention.

Hi @SolalSPC ,
Could you share what the callback function does? From where does it retrieve the options?

Here’s the callback function :

def createFdesPepOptions(params,**kwargs):
  
  if database == {}:
      return []
  else:
      idlist = [x[0] for x in database.items()]    
      fdes_pep_options = [OptionListElement(id, label = id + ' - ' + database[id]['Nom du produit'][0][:109]) for id in idlist]
      
      if fdes_pep_options == None :
          return []
      return fdes_pep_options

To give you some context, database is a json-formatted string that I declare as a global variable in app.py, it is then overwriten with data retrieved through an API when the user types in some IDs in a text field.

This callback function is used to display options on the next Step depending on the IDs given by users at the first Step.

Thanks in advance.

Maybe there’s a difference when calling the API? are you using an environment variable of some sorts to authenticate?

It’s very difficult to help you without a full example showing the problem. I cannot replicate the difference on callback behavior between development and production.

Yes, I understand, I’ll continue to investigate, I’ll post an update there when I fix the problem.