Duplicate widgets created when switching instances in VS Code, or when pulling code from repository
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 08:51 AM
Hi all,
My company has a lot of instances, and we switch instances every 1-2 months when working on a new feature because we have so many teams. When switching the connection to another instance in VS Code, we'll sometimes create duplicate widgets in our ServiceNow instances when syncing files to the instance. We used to resolve this like so:
- Find and delete the duplicate widget in ServiceNow instance,
- Click on the "Sync Project" button in VS Code
- Resolving the duplicates in the window that pops up in VS Code
- Click on "Sync Project" again to complete the sync project
- Discard all changes in our VS Code source control because we don't want to commit them to the repository
- Everything is back to normal with no duplicates in our VS Code
Lately these steps haven't been working because as soon we discard all changes in Step 5, all the duplicates just show back up.
Another scenario is where if a developer created a new widget or file within the ServiceNow instance, and they make a pull request (PR) that gets completed and merged into our main branch. We would pull the latest code into our main branch on VS Code and the new files would get created, but these new files are not the original versions from the ServiceNow instance. Trying to cop the sys_id of that file in VS Code will throw an error saying the file hasn't been synced, and syncing the file will then create a duplicate record of that file in the ServiceNow instance.
It's all a big headache and I'm wondering if there are ways to avoid these duplications, and if y'all have an methods of resolving these duplicates in VS Code because our usual method that I mentioned doesn't working anymore.