I tried it another way and it changed it for a second then it went right back.
function publishServiceProvider.updateCollectionSettings( publishSettings, info )
local colname = "This is my new collection name"
LrLibLogger.outputToLog( colname )
local pubcol = catalog:getPublishedCollectionByLocalIdentifier( info.publishedCollection.localIdentifier )
catalog:withWriteAccessDo( "Set name", function ()
pubcol:setName( colname )
info.name = colname
LrLibLogger.outputToLog(pubcol:getName()) -- outputs the old name and not the new one
Looks like the name in the 'Edit collection...' dialog gets 'committed' after the name you set programmatically in your plug-in code. Thus the momentary effect you observed.
I've tested your second version of your code, and although I can't find why the name isn't fixed, I get an error, only when creating a new collection:
"We can only wait from within a task"
I found this at the Adobe documentation for pubCollection:getName():
"This function must be called from within an asynchronous task started using
LrTasks. Must not be called from within the same
catalog:with___WriteAccessDogate in which the collection object was created."
I'm very new to Lua and LR development, but I hope this helps.