You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the documentation, data context import function can receive an argument of type ImportOptions, which has an id corresponding to the workspace that the import should be executed at.
Actual Behavior
Even if I pass a valid workspaceId on the ImportOptions argument, the import occurs, but it creates a new workspace instead of importing the contents on the actual workspace.
Reproduction Steps
Create a plugin with minimal code in index.js eg:
module.exports.workspaceActions=[{label: 'Pull from GIT',icon: 'fa-arrow-down',action: async(context,data)=>{constimpFilename='example.json';if(!fs.existsSync(impFilename)){context.app.alert('Error importing','Seems example.json is not existing!');returnfalse;}fs.readFile(impFilename,"utf8",function(err,fileContent){context.data.import.raw(fileContent,{workspaceId: data.workspace._id,});});},}];
Try to import it. The ImportOptions were removed so it is not possible anymore to send a workspaceId. This basically switches the import of workspaces to import of projects and breaks many plugins: add support for multiple workspaces in one import file #6044
Credits to @sebastiande for the code snippets for reproduction steps.
I don't think this should be the expected behaviour, or the documentation should be updated as it leads developers to assume that this behaviour is what was going to happen.
On my case, I am developing an internal plugin for the company that I work, and this is a blocker that I could not imagine when I was studying what the Insomnia plugins are capable of.
This was already discussed at #6125, however I don't think that the main issue was understood, since "sync" features started being discussed on the thread, even though the discussion was about importing contents of an exported collection/design document on the current workspace.
Also, I searched on the source code of Insomnia and did not find any occurrence of the string "ImportOptions" on the code, which make me think this is a deprecated feature and the documentation is outdated.
Is it correct to assume any of this or is this a known issue that is already under fix from Insomnia team collaborators?
Thanks in advance.
Insomnia Version
2023.5.5
What operating system are you using?
Windows
Operating System Version
Microsoft Windows 11 Pro
Installation method
download from insomnia
Last Known Working Insomnia version
No response
The text was updated successfully, but these errors were encountered:
I was reviewing this PR #6044 as already mentioned and confirmed that the ImportOptions do not exist anymore and creating a new workspace is the expected behaviour.
I thought on creating a PR to change this, however I would like to know for what purpose this was removed from the code, since it removes a great import feature and perhaps there is a reason behind it and a PR returning this feature to the code would be pointless.
Also, the documentation is confirmed to be outdated as well, leading to misunderstanding.
Expected Behavior
Following the documentation, data context import function can receive an argument of type ImportOptions, which has an id corresponding to the workspace that the import should be executed at.
Actual Behavior
Even if I pass a valid workspaceId on the ImportOptions argument, the import occurs, but it creates a new workspace instead of importing the contents on the actual workspace.
Reproduction Steps
Credits to @sebastiande for the code snippets for reproduction steps.
Is there an existing issue for this?
Additional Information
I don't think this should be the expected behaviour, or the documentation should be updated as it leads developers to assume that this behaviour is what was going to happen.
On my case, I am developing an internal plugin for the company that I work, and this is a blocker that I could not imagine when I was studying what the Insomnia plugins are capable of.
This was already discussed at #6125, however I don't think that the main issue was understood, since "sync" features started being discussed on the thread, even though the discussion was about importing contents of an exported collection/design document on the current workspace.
Also, I searched on the source code of Insomnia and did not find any occurrence of the string "ImportOptions" on the code, which make me think this is a deprecated feature and the documentation is outdated.
Is it correct to assume any of this or is this a known issue that is already under fix from Insomnia team collaborators?
Thanks in advance.
Insomnia Version
2023.5.5
What operating system are you using?
Windows
Operating System Version
Microsoft Windows 11 Pro
Installation method
download from insomnia
Last Known Working Insomnia version
No response
The text was updated successfully, but these errors were encountered: