Forum OpenACS Development: ad_set_client_property not persisting initial value to the database

In debugging an issue on 5.10.1 I've found that the ad_set_client_property proc is not persisting the initial value to the database. Subsequent calls will update the value properly but the initial call does not set property_value column.

This is on PostgreSQL and the way the db function is written the update is not setting the value on the INSERT statement and the way the author expected the LOOP to work appears to be exiting early after the initial INSERT.

For now one way to resolve it in our testing is to just include the property_value in the INSERT so the value is initialized properly. The problematic db function is sec_session_property__upsert

Is there a reason why the `insert into sec_session_properties` call wouldn't have included the property_value column as part of the initial insert?

Thanks.

Dear Jonathan,

your diagnosis is correct, the issue is fixed in the repository.

I am somewhat surprised that this issue did not come up earlier, since this function was introduced 9 years ago (June 2015) and was not changed. Probably, this has to do with the use pattern of this property ... When I look at the release dates, the broken function was included already in OpenACS 5.9.0.

  • OpenACS 5.10.0: Sep 15, 2021
  • OpenACS 5.9.1: August 08, 2017
  • OpenACS 5.9.0: December 01, 2015

So, it seems to me that you updated from quite an old version to OpenACS 5.10.1, otherwise the issue would pop up earlier in your application as well.

Anyhow, many thanks
-g