Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

fix(process): proc status lost when streaming

Open MiroKaku opened this issue 1 year ago • 1 comments

Description

Steps to reproduce:

  1. Start any streaming using moonlight.
  2. Return to the app selection page.
  3. Open the sunshine Web-UI, delete or add any application.
  4. Streaming status on moonlight has been lost.

Reason:

  void
  refresh(const std::string &file_name) {
    auto proc_opt = proc::parse(file_name);

    if (proc_opt) {
      proc = std::move(*proc_opt); // <---- !!!! Look here, It is overwritten.
    }
  }

Screenshot

None

Issues Fixed or Closed

None

Type of Change

  • [X] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Dependency update (updates to dependencies)
  • [ ] Documentation update (changes to documentation)
  • [ ] Repository update (changes to repository files, e.g. .github/...)

Checklist

  • [X] My code follows the style guidelines of this project
  • [X] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

MiroKaku avatar Nov 25 '24 03:11 MiroKaku

Could you add documentation blocks for the new methods in the header file (not in the cpp file)?

https://docs.lizardbyte.dev/projects/sunshine/en/master/md_third-party_2doxyconfig_2docs_2source__code.html#documentation-blocks

done.

MiroKaku avatar Jan 21 '25 09:01 MiroKaku

Also @ReenigneArcher, why do we use -1 here? image

Is 0 not good enough?

FrogTheFrog avatar Jan 22 '25 16:01 FrogTheFrog

Not sure exactly where that code comes from, but 0 is the first app.

ReenigneArcher avatar Jan 22 '25 17:01 ReenigneArcher

Not sure exactly where that code comes from, but 0 is the first app.

But then we have a lot of places in the code checking running() > 0 to determine if any app is running. Which is incorrect...

We should change the app_id type to std::optional<int> in some other PR...

FrogTheFrog avatar Jan 22 '25 17:01 FrogTheFrog

That whole system problem needs to be re-thought. As far as I see, app_id is not even real, it's more like an app index.

ReenigneArcher avatar Jan 22 '25 18:01 ReenigneArcher

I've added some comment style suggestion, based on the feedback I've got from RA in my other commits.

Also I've found some other issues with the env that I would like you to fix. Sorry, that such a simple PR turned out to explode. If you prefer I can also take over the requested changes, just let me know.

I would prefer if you could take over the requested changes. Thank you! 😀

MiroKaku avatar Jan 23 '25 06:01 MiroKaku

@ReenigneArcher I will move some data around without changing logic too much. This should automatically resolve all of the known issues.

FrogTheFrog avatar Jan 23 '25 08:01 FrogTheFrog

@MiroKaku Have you perhaps unchecked the checkbox where maintainers or something can push to the branch? If so, can you enable it?

Otherwise I will have to create a fork :/

FrogTheFrog avatar Jan 29 '25 13:01 FrogTheFrog

@MiroKaku Have you perhaps unchecked the checkbox where maintainers or something can push to the branch? If so, can you enable it?

Otherwise I will have to create a fork :/

It is checked, but I don't think it allows "Collaborators" to push to.

ReenigneArcher avatar Jan 29 '25 14:01 ReenigneArcher

I will create a fork then.

FrogTheFrog avatar Jan 29 '25 14:01 FrogTheFrog

It looks like this PR has been idle for 90 days. If it's still something you're working on or would like to pursue, please leave a comment or update your branch. Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks!

LizardByte-bot avatar Apr 30 '25 10:04 LizardByte-bot

This PR was closed because it has been stalled for 10 days with no activity.

LizardByte-bot avatar May 11 '25 10:05 LizardByte-bot