# Bug COMMS-988 - Work package identifiers not updated after alleged successful migration

Project: Stream Communicator
Status: closed
URL: https://community.openproject.org/work_packages/COMMS-988

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Modules and project features / Work packages |
| Target versions | 17.9.5 |
| Observed in versions | 17.5.0 |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) | 17.5.x |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Pavel Balashou |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

<br>

The bug occurred for me when switching identifier modes using the web UI. The first time I tried this, it showed the table of projects whose identifiers needed to be migrated, as expected (the only annoyance being that it truncated the list of projects without giving me an option to see the full list).

After I pressed the button to convert and confirmed in the dialog, it showed the progress bar, followed by a message that the conversion had succeeded, but the old "instance-wide numerical sequence" option remained selected, even after refreshing, and although project identifiers had been successfully migrated, work packages were still showing the old instance-wide identifiers.

When trying again, it did not show any projects to migrate, but it still showed the progress bar and the success message, but with the same result.

I then checked the Rails server and worker logs in Docker. The server showed no errors, but the worker showed this error message:

<br>

``` text
I, [2026-06-10T08:42:22.376789 #24]  INFO -- : [ActiveJob] [ProjectIdentifiers::ConvertInstanceToSemanticIdsJob] [37ebb923-8acf-46cb-b15c-d9e25c05666e] Performing ProjectIdentifiers::ConvertInstanceToSemanticIdsJob (Job ID: 37ebb923-8acf-46cb-b15c-d9e25c05666e) from GoodJob(default) enqueued at 2026-06-10T08:42:22.358931048Z
E, [2026-06-10T08:42:22.388989 #24] ERROR -- : [ActiveJob] [ProjectIdentifiers::ConvertInstanceToSemanticIdsJob] [37ebb923-8acf-46cb-b15c-d9e25c05666e] Error performing ProjectIdentifiers::ConvertInstanceToSemanticIdsJob (Job ID: 37ebb923-8acf-46cb-b15c-d9e25c05666e) from GoodJob(default) in 11.64ms: ActiveModel::MissingAttributeError (missing attribute 'jobs_finished_at' for GoodJob::BatchRecord):
app/workers/project_identifiers/convert_instance_to_semantic_ids_job.rb:38:in 'ProjectIdentifiers::ConvertInstanceToSemanticIdsJob#perform'
app/workers/shared_job_setup.rb:59:in 'block in SharedJobSetup#prepare_job_context'
app/workers/shared_job_setup.rb:76:in 'SharedJobSetup#with_clean_request_store'
app/workers/shared_job_setup.rb:55:in 'SharedJobSetup#prepare_job_context'
I, [2026-06-10T08:42:22.389140 #24]  INFO -- : [GoodJob] [24] [GoodJob::Scheduler(queues=* max_threads=20)-thread-19] Executed GoodJob 37ebb923-8acf-46cb-b15c-d9e25c05666e
```

<br>

When running the job in the Rails console using `ProjectIdentifiers::ConvertInstanceToSemanticIdsJob.perform_now`, I got the same error message as in the logs.

I checked the source code for this job and saw that it was performing a sub-job for each project returned from `ProjectIdentifiers::PendingProjectsFinder.project_ids`, so I ran this in the Rails console and found that it returned zero projects.  
I was able to work around the bug by telling it to finish the conversion anyway. The stubbed `batch` argument was required to bypass the `discarded?`\`check in the finish job, but is otherwise unused.

``` text
ruby
batch = Struct.new(:discarded?).new(false)
ProjectIdentifiers::FinishSemanticConversionJob.perform_now(batch)
```

This finished without error, so my best guess as to the cause of the bug is some problem with either the `FinishSemanticConversionJob` that prevents it from being scheduled, or with the use of the `on_finish` option passed to `GoodJob::Batch.enqueue`.

After running this, semantic identifiers are now correctly used throughout the application, and the semantic identifiers option is now selected in the UI for switching identifier modes.

I'm not sure whether I would be able to reproduce this bug, and I have no desire to attempt to do so on my own instance for fear of causing data corruption. But hopefully reporting this bug will be helpful to anyone experiencing the same issue, and perhaps someone familiar with the code will know from the above information what the problem is likely to be.

### What is the buggy behavior?

<br>

  - Work packages still show numerical identifiers after migration to project related identifiers. Migration dialog displayed a successful migration though.

### What is the expected behavior?

<br>

1.  Identifiers are chaged after the web UI dialog confirms a successful migration.

### 

### **Logs**

*see above*

### 

### Environment information

<br>

**OpenProject installation type**

  - Docker-compose installation

**OpenProject version**

*17.5*

**Browser**

- [ ] Chrome
- [ ] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other (please specify)

**Operating System**

- [ ] Windows
- [ ] Mac OS X
- [ ] Mobile iOS
- [ ] Mobile Android
- [ ] Linux (please specify distro)
- [ ] Chrome OS
- [ ] Other (please specify)

**Language**

*EN*
