Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit mode vs. Browse mode #1752

Closed
sebjulliand opened this issue Dec 24, 2023 Discussed in #1331 · 4 comments · Fixed by #1757
Closed

Edit mode vs. Browse mode #1752

sebjulliand opened this issue Dec 24, 2023 Discussed in #1331 · 4 comments · Fixed by #1757
Assignees
Labels
enhancement New feature or request

Comments

@sebjulliand
Copy link
Collaborator

Discussed in https://github.com/orgs/codefori/discussions/1331

Originally posted by Gregory1701 June 1, 2023
I (as well as at least one of my coworkers) think it would be nice if the open source member tab somehow indicated whether you were in Edit mode or Browse mode. RDi does this by showing a pencil vs a spyglass.

The problem we're looking to resolve is this.

  • Ctl+Alt+P and open a source member which exists in my development library as well as in production
  • I opened a version of a source member that is in our production library (let's say by accident)
  • Start making the necessary changes, then go to save the source member, compile, etc.
  • But then I discover that I cannot save it. I do get notified with this:
    image
    However, maybe I'm the only one, but if I get a bunch of source members open, then get pulled into a teams meeting, then go for a run, come back and start banging out some code changes, it would be nice to have the icon at the top (like in RDi) letting me know that I'm in browse mode.

Proposed solution

  • Run CHKOBJ at the source PF level to check the *WRITE authority
  • Add a new connection setting which is a comma separated list of libraries that will always be protected (same as having them in a protected filter)
  • Add an Open submenu to members offerring to chose between Edit and Browse
  • Add a new global setting to define the default behavior (edit or browse) when opening a member with a left click
@sebjulliand sebjulliand added the enhancement New feature or request label Dec 24, 2023
@sebjulliand sebjulliand self-assigned this Dec 24, 2023
@sebjulliand
Copy link
Collaborator Author

Hi @Gregory1701 !
I started working on this issue and while I was looking at running CHKOBJ to check if members can be updated I found out...we already do it 😅
We actually run CHKOBJ AUT(*UPD) on the source file so no need to run it on each members.

But I gave a better look at the error message you had in your first post, and it's actually not the member that cannot be written to. The error is raised by the CPYFRMSTMF call we do at some point while saving.

A temporary, intermediate stream file is used during the save process. We first copy the VSCode editor's content into a local temporary file and then we upload this file in a temporary location on the IFS. Finally, a CPYFRMSTMF is issued to copy the stream file content into the target member. So that CPDA084 message means the intermediate stream file could not be opened, not the source physical file!

Sorry for the long explanation but I wanted to give you the right context. Now, the question is WHY on earth did CPYFRMSTMF failed to open this file? To answer this question and provide a fix, I'd like to know if you could re-create the issue, then copy here the content of your Code for IBM i output (to see what actually happened). If possible, try to run the same CPYFRMSTMF as the one you'll see in the output in a 5250 session, then use DSPJOBLOG to look for the actual reason why the file could not be opened.

Thanks a lot in advance! 😉

@Gregory1701
Copy link

Hey @sebjulliand, I have tried to recreate this, but it seems to have been fixed. When I open a source member via Ctl+Alt+O, Ctl+Alt+P or clicking on the source member within a filter, then try to edit it I get this message:
image

My version info:
Version: 1.85.1 (user setup)
Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Date: 2023-12-13T09:49:37.021Z
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22621

I guess somewhere in the 6 months of enhancements you guys have been putting out, someone added this message. But I think it's fixed!

@sebjulliand
Copy link
Collaborator Author

Thanks for the feedback @Gregory1701 !
OK sounds good; but if you ever see this CPDA084 message again, feel free to report it with the whole output, etc.

Have a great end of 2023 😉

@sebjulliand
Copy link
Collaborator Author

@Gregory1701 the release containing the PR related to this discussion is out now. You can now set your default open action and define libraries and/or paths to protect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants