New package: topgrade-rs.topgrade version 14.0.1

- [X] Have you signed the Contributor License Agreement?

[ ] Have you checked that there aren't other open pull requests for the same manifest update/change?

[X] Does your manifest conform to the 1.5 schema?

Resolves #66558

Microsoft Reviewers: Open in CodeFlow

2024-01-25 21:15:32.325 [FAIL] Installer failed security check. Url: https://github.com/topgrade-rs/topgrade/releases/download/v14.0.1/topgrade-v14.0.1-x86_64-pc-windows-msvc.zip Result: 0x80004005

Will have to retry in a day or two

Hi @Trenly,
The package didn't pass a Defender or similar security scan. This might be a false positive and we can rescan tomorrow.
(Automated response - build 660.)

Automatic Validation ended with:

Installation failed with exit code -1978335187 2024-01-25 21:15:32.325 [FAIL] Installer failed security check. Url: https://github.com/topgrade-rs/topgrade/releases/download/v14.0.1/topgrade-v14.0.1-x86_64-pc-windows-msvc.zip Result: 0x80004005 MSI (s) (60:A8) [21:15:18:632]: Windows Installer installed the product. Product Name: Microsoft Visual C++ 2022 X64 Minimum Runtime - 14.38.33130. Product Version: 14.38.33130. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation success or error status: 0. MSI (s) (60:FC) [21:15:19:788]: Windows Installer installed the product. Product Name: Microsoft Visual C++ 2022 X64 Additional Runtime - 14.38.33130. Product Version: 14.38.33130. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation success or error status: 0. [1F74:1C4C][2024-01-25T21:15:16]w363: Could not create system restore point, error: 0x80070422. Continuing...

(Automated response - build 660.)

/AzurePipelines run

Hi @Trenly,
The package didn't pass a Defender or similar security scan. This might be a false positive and we can rescan tomorrow.
(Automated response - build 669.)

Automatic Validation ended with:

Installation failed with exit code -1978335187 2024-01-26 14:25:48.958 [FAIL] Installer failed security check. Url: https://github.com/topgrade-rs/topgrade/releases/download/v14.0.1/topgrade-v14.0.1-x86_64-pc-windows-msvc.zip Result: 0x80004005 MSI (s) (A0:50) [14:25:36:513]: Windows Installer installed the product. Product Name: Microsoft Visual C++ 2022 X64 Minimum Runtime - 14.38.33130. Product Version: 14.38.33130. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation success or error status: 0. MSI (s) (A0:F0) [14:25:37:497]: Windows Installer installed the product. Product Name: Microsoft Visual C++ 2022 X64 Additional Runtime - 14.38.33130. Product Version: 14.38.33130. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation success or error status: 0. [08C0:10B4][2024-01-26T14:25:34]w363: Could not create system restore point, error: 0x80070422. Continuing...

(Automated response - build 669.)

/AzurePipelines run

Hi @Trenly,
The package didn't pass a Defender or similar security scan. This might be a false positive and we can rescan tomorrow.
(Automated response - build 675.)

Automatic Validation ended with:

Installation failed with exit code -1978335187 2024-01-29 20:17:41.512 [FAIL] Installer failed security check. Url: https://github.com/topgrade-rs/topgrade/releases/download/v14.0.1/topgrade-v14.0.1-x86_64-pc-windows-msvc.zip Result: 0x80004005 MSI (s) (DC:54) [20:17:25:620]: Windows Installer installed the product. Product Name: Microsoft Visual C++ 2022 X64 Minimum Runtime - 14.38.33130. Product Version: 14.38.33130. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation success or error status: 0. MSI (s) (DC:EC) [20:17:27:589]: Windows Installer installed the product. Product Name: Microsoft Visual C++ 2022 X64 Additional Runtime - 14.38.33130. Product Version: 14.38.33130. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation success or error status: 0. [0A8C:1874][2024-01-29T20:17:22]w363: Could not create system restore point, error: 0x80070422. Continuing...

(Automated response - build 675.)

/AzurePipelines run

Hi @Trenly,
The package didn't pass a Defender or similar security scan. This might be a false positive and we can rescan tomorrow.
(Automated response - build 694.)

Automatic Validation ended with:

Installation failed with exit code -1978335187 2024-01-31 18:31:16.586 [FAIL] Installer failed security check. Url: https://github.com/topgrade-rs/topgrade/releases/download/v14.0.1/topgrade-v14.0.1-x86_64-pc-windows-msvc.zip Result: 0x80004005 MSI (s) (BC:68) [18:31:04:096]: Windows Installer installed the product. Product Name: Microsoft Visual C++ 2022 X64 Minimum Runtime - 14.38.33130. Product Version: 14.38.33130. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation success or error status: 0. MSI (s) (BC:D4) [18:31:05:018]: Windows Installer installed the product. Product Name: Microsoft Visual C++ 2022 X64 Additional Runtime - 14.38.33130. Product Version: 14.38.33130. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation success or error status: 0. [0460:1FFC][2024-01-31T18:31:01]w363: Could not create system restore point, error: 0x80070422. Continuing...

(Automated response - build 694.)

/AzurePipelines run

@stephengillie Thanks for adding topgrade to winget-pkgs. I was looking forward to automating the process via https://github.com/marketplace/actions/winget-releaser. Would be nice to hear your thoughts on it here https://github.com/topgrade-rs/topgrade/discussions/675.


Fixes Issue#3776. Corrected the implementation for Flags.remove()

Note - I've written a test-suite to cover 90% of this module but it's dependent on a second PR that I'm about to open.
Test coverage is in there.

The title of the PR will appear in the changelog, can you change it to something more "end user friendly"?

FYI a "Fixes X" should appear in general at the end of the commit comment.

Hi @redvers,
The changelog - fixed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do.
Release notes are added by creating a uniquely named file in the .release-notes directory. We suggest you call the file 3777.md to match the number of this pull request.
The basic format of the release notes (using markdown) should be:
## Title

End user description of changes, why it's important,
problems it solves etc.

If a breaking change, make sure to include 1 or more
examples what code would look like prior to this change
and how to update it to work after this change.

Thanks.

I'd rather see the test coverage as either part of this PR or for the test coverage PR to come first and this to follow. There's no test here to show this works and doesn't break other things.
I'd be in favor of adding the test coverage to this PR.

So, my test suite uses the new create() constructor throughout... so won't work unless that change is also merged.
eg:

    // Mutable Bitwise Operator: without
                                                           // 0b0011
                                                           // 0b0101 without
    h.assert_true(set0011.without(set0101) == _TestFlagsFlags(0b0010))
                                                           // 0b0101
                                                           // 0b0011 without
    h.assert_true(set0101.without(set0011) == _TestFlagsFlags(0b0100))

    // Mutable Operator: union
    t = set0011.clone()              //0b0011
    t.union(set0101)                 //0b0101
    h.assert_true(t == _TestFlagsFlags(0b0111))

    // a.union(b) == b.union(a)
    t = set0101.clone()              //0b0101
    t.union(set0011)                 //0b0011
    h.assert_true(t == _TestFlagsFlags(0b0111))
    ```

    Should I put it all in one then?

Is the bug possible without the create change?

I'll re-write the test suite to use the other format and push.

@redvers can you update the commit comment to be:
Fix bug where Flags.remove could set flags in addition to unsetting them

Flags.remove when given a flag to remove that wasn't currently present in the set, would turn the flag on.
It should only be turning flags off, not turning them on.

Closes #3776

Release notes of
## Fix bug where Flags.remove could set flags in addition to unsetting them

Flags.remove when given a flag to remove that wasn't currently present in the set, would turn the flag on.
It should only be turning flags off, not turning them on.

would be good as well.

These two

https://playground.ponylang.io/?gist=038f92acb95f87e33a2cdbcfae335e40
https://playground.ponylang.io/?gist=2dfbb2ea6a8fa1af192ebeba86474bd8

as tests would be good enough coverage for me to push this update through.

@redvers I can do the commit comment change on squash/merge.

If it's okay with you I'd like to do the squash.  I want to make sure I understand the full-workflow so any future work will require less work from the maintainers.

@redvers fine with me.

Okay - so I think pending CI - I think that's everything? Yay!


Implement key-value pair iteration of dictionaries

Implementation includes parsing of both variables, type hints, basic static analysis and type checking, compiling, and runtime type-checking. The implementation writes an implicit assignment from the index (first for variable) of the container to the second for variable before the suite, within the compilation and code generation stages.
Added a new OPCODE (OPCODE_FOR_SECOND_VARIABLE_DICT_TYPE_TEST), used when a second variable is declared, to check if type of container is a dictionary at runtime before entering the loop.
Example grammar:
forStmt = "for" IDENTIFIER [ “:” typeHint] [ “,” IDENTIFIER [ “:” typeHint ]]” in" expression ":" stmtOrSuite ;
Unit tests added (.gd and .out):

parser/features/for_key_value_pair : basic success test
parser/features/for_key_value_pair_with_type_specifiers : successful key-value pair iteration on dictionary with type specifiers for both key and value variables
runtime/features/for_key_value_multiple_types : successful key-value pair iteration on dictionary with multiple types
runtime/errors/for_key_value_not_dictionary : error on key-value pair iteration on non-dictionary container
runtime/errors/for_key_value_incompatible_types : error on incompatible types between the static type hint and the container’s elements’ type

@dalexeev

Changed the grammar and parser to your request, as it makes more sense:
forStmt = "for" IDENTIFIER [ “:” typeHint] [ “,” IDENTIFIER [ “:” typeHint ]] in" expression ":" stmtOrSuite ;

Fixed by adding a new OPCODE (OPCODE_FOR_SECOND_VARIABLE_DICT_TYPE_TEST) that checks if the container is a dictionary at runtime before the for loop instead of checking at compile time.

Fixed.

Added tests akin to the issues you raised.


BLD: ban caproto version 0.2.3

This version of caproto makes unconditional use of a feature in the
socket module that may or may not be there depending on the kernel
version on the machine that compiled the cpython binary.
In particular recent builds of cpython from conda are built on a
sufficiently old kernel that the reuse_port option is not available.

Thanks!


Add rack_id field for Kafka components

Fixes #560.
I managed to run the TestIntegration/kafka_redpanda and TestIntegration/kafka_old integration tests in a DinD container, since kafka_old requires the correct host IP which doesn't work directly on Docker for Mac. There doesn't seem to be any easy way to add a specific test for this field, so I guess we'll just have to count on Sarama to do the right thing.
Annoyingly, since ListNetworks doesn't work correctly in DinD, I hardcoded the "host" IP address in the code to run the kafka_old tests. There's a bug report for this since 2016 🤦♂

Looks good, thanks @mihaitodor! But yikes on that ancient issue.


Is it possible to come back to the aspect of 0.19?

Hello. I had version 0.19 and I liked very much the aspect of it, very vivid colors. I have upgraded to the last version and it looks worse for me, because the colors are darker and the book icon is different. Is there any way of getting back the colors/aspect of 0.19 while maintaining the new features of 0.27.5?
Thank you very much

Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.


corrected bookmark-toggle effect

Fixes Issue
Fixed the bookmark-toggle button in the posts

Changes proposed
Updated toggle effect using isSaved variable which is good enough...

Screenshots

Screencast from 2024-05-14 19-14-56.webm
Note
There are issues within the backend of adding saved posts into the respective user account, I don't know much about the typescript :(, but I would try to learn and resolve that issue ( If it is assigned to a level-3 label :) )
Until then, I hope you will love the current changes I made @Nishitbaria (Don't forget to add a level-1 label !!)

Thank you for your contribution @venkatasai24


Alarmtype and alarmlevel not returned from door locks.

Version
Build/Run method
zwavejs2mqtt version: 3.2.0
zwave-js version: 7.1.1
Describe the bug
This is probably related to the latest breaking changes in Home Assistant in regards to notifications and labels in upstream zwave JS being changed. (https://www.home-assistant.io/blog/2021/04/07/release-20214/#breaking-changes)
When I change the state of my door lock, it no longer reports alarmlevel and alarmtype to Home Assistant but instead produces the following error in the zwavejs2mqtt debug log:
2021-04-08 15:53:55.286 INFO ZWAVE: Node 23 CC Notification { type: 6, event: 4, label: 'Access Control', eventLabel: 'RF unlock operation', parameters: undefined }
To Reproduce
Unlock or lock the lock via zwave command or lock buttons.
Expected behavior
The alarmtype and alarmlevel should be returned.
Additional context
My locks are Kwikset 910 locks. This was working prior to the updates today. I updated both Home Assistant as well as zwavejs2mqtt. Not sure which one caused the problem but I am guessing it is related to the breaking changes noted above.

That's no error and this is working as intended.

Ok. I get that now in reading the update again. Since I am not getting any alarmType and alarmLevel, I assume it is not mapped?
Event 0 fired 7:23 AM: {     "event_type": "zwave_js_notification",     "data": {         "domain": "zwave_js",         "node_id": 22,         "home_id":<PHONE_NUMBER>,         "device_id": "acf3e697399c0d630dd11de5767d252a",         "command_class": 113,         "command_class_name": "Notification",         "label": "Access Control",         "type": 6,         "event": 4,         "event_label": "RF unlock operation",         "parameters": {}     },     "origin": "LOCAL",     "time_fired": "2021-04-09T12:23:33.652135+00:00",     "context": {         "id": "297844ef4a128cbb796ca9bb05d81aa7",         "parent_id": null,         "user_id": null     } }

Since I am not getting any alarmType and alarmLevel, I assume it is not mapped?

I think you have that backwards. Because you're not getting any, they are mapped to a standardized event :)

A few sips of coffee later and I see now. I need to watch the event_label values in my automations to return this back to the way it was working before. This can be closed if you like. Thanks!


Directives should only be specified inline

I was thinking that perhaps we should not allow to pass directives as part of the doctest call. Instead, all directives should be specified inline (as comments in the actual doctests). My rationale is that doctests should be self-documenting and self-contained: it should always be possible to call doctest <function>.
Let me know what you think; I'm happy to provide a PR.

A much weaker position would be allow it but stop advertising it at the top of doctest.m's help text: I'd be ok with that for 0.4.x.

Sounds good! Do you have any thoughts on eventually phasing out that capability?

Have not really thought about it yet.  As a general rule, fewer knobs is good: add them once support them forever.
But to add a data point: I think Python doctest does allow specifying directives globally.  No idea how much this is used in practice.

While we're thinking about this project again, should we at least take the "weaker position" mentioned above?

Just out of curiosity - have you ever found a use case for this functionality?

No, not in practice.
I guess theoretically the WHITESPACE one could be used in this way: I figured projects might have project-wide preferences about these things...  I

That's true. I feel that it is desirable that doctest <target> always works -- possibly after some setup script has been run that configures paths etc. One might also want to run doctests for targets in different projects, so this seems to preclude any solution that modifies the default directives by setting some global variables.
I think doctest could load the closest .doctestrc file in the target's directory or one of its parent directories before running doctests. I can't think of a major downside (it should be reasonably fast since it will only be done once for invocations like doctest .), but am not so inclined to implement it without a user/use case.
How about we (1) deprecate and subsequently remove support for specifying directives at the command level in the next major version, and (2) accept patches for adding project-global support for modifying directives (using e.g. a .doctestrc file).


update to unexpected v10 and take advantage of types

merge this once v10 of unexpected is ready to go.

This fails because unexpected haven't been released in v10 yet and the tests thus runs against the v9 release.

You should probably also update package.json.


Autodetect Steam ID

There may be ways to autodetect steam id from tf2_playerstats.dmx or other files.

done


Goto fixes

Uhh I have no idea what I am doing... I need to learn some Git ^^

Unclear pull request, please provide more structured code (and possibly learn some Git before your next pull request)

¯_(ツ)_/¯ what that even means, so well, yay


cannot authenticate

I am getting error:
AttributeError: 'module' object has no attribute 'client'
I have been using this code for months and suddenly I cannot authenticate.

nevermind. microsoft/ xbox live was having issues. the code still works!

awesome!


Bug fix to ensure overlapping outbreak events do not result in more than one exposure per checkin

Summary | Résumé
When we get outbreak events from the server that overlap the same day for a single location, this can result in multiple exposures for the same check in. This is visible to the user in the recent exposure history. We should only count this as one exposure, and display the guidance for the most severe of the outbreak events the user matched with. If there were overlapping outbreak events with the same severity, it doesn't matter which one we choose to keep so I am arbitrarily keeping the one with the latest endTime.

Retest completed on 3 Androids phones:

Android MotoG6 V9 (Dev 1.2.9 (311)), I5N1ZGZ7
Android Pixel 2 V9 (Dev 1.2.9 (311)), DCJZ7NVH
Android S7 V8.0 v12.5.1 (Dev 1.2.9 (311)), H3AV169C
Exposures were not duplicated for Proximity or Outbreak in the 'Your recent exposures' list.
Retest Passed


enqueue_block_assets not loading styles in WP 5.0

It looks like blocks.style.build.css is not being enqueued in WordPress 5.0 with Gutenberg active, unless using the Gutenberg plugin.

Does the suggested fix in #107 solve this issue for you?

I suppose that should be fixed by now. I am traveling would take a look if it's not. Let me know.


How to analyze a subsection of .abf?

Hello, I am wondering if there is a way to run a portion of a file and not the whole file? Some of my recordings have weird noise at the beginning or I'll start to loose a cell at the end and only want to use the beginning half of the recording. It would be nice to either be able to crop a recording or tell miniML to only look at a portion of the recording. Do you know of a way to do this?

I think this is working for me
#cropping a recording-- find new starting point in seconds and multiply by sampling rate/ms (s*100000)
starting_point_seconds = ###add number here in seconds
starting_point = starting_point_seconds * 100000
ending_point_seconds = ###add number here in seconds
ending_point = ending_point_seconds * 100000
trace.data = trace.data[starting_point:ending_point]

If you want to exclude multiple small stretches, something like this should work:
import numpy as np
t1, t2 = 0, 30 # get the first 30 s
p1, p2 = int(t1/trace.sampling), int(t2/trace.sampling)
stretch_1 = trace.data[p1:p2]
t1, t2 = 90, 120 # get the last 30 s
p1, p2 = int(t1/trace.sampling), int(t2/trace.sampling)
stretch_2 = trace.data[p1:p2]
trace.data = np.concatenate((stretch_1, stretch_2))

miniML's MiniTrace Objects represent data as standard NumPy 1d-arrays. Accordingly, regular NumPy indexing can be used to crop the data in various flexible ways. The two previous posts illustrate this nicely. I therefore close this issue.


new URL(url, import.meta.url) should not be fatal in SSR mode when its never called

Describe the bug
Temporary fix
Relevant line in Vite source that throws the described error
Relevant vite-plugin-rsw issue
Relevant SvelteKit issue
vite-plugin-rsw, is a plugin that lets one use Rust on the web with all the good things that come with Vite(HMR, SSR, ...).
That plugin uses wasm-pack under the hood, which creates javascript glue code and types to easily interface with the wasm file.
The glue code contains the following segment, which seems to create an error in Vite when SSR is enabled in SvelteKit:
async function init(input) {
    if (typeof input === 'undefined') { // not executed if input exists
         input = new URL('example-rust-crate-rs_bg.wasm', import.meta.url); // Error: 'new URL(url, import.meta.url)' is not supported in SSR.
    }
    const imports = {};

    if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
        input = fetch(input);
    }

    const { instance, module } = await load(await input, imports);

    wasm = instance.exports;
    init.__wbindgen_wasm_module = module;

    return wasm;
}

If the init function is called with a path to the .wasm file then that line never gets executed but Vite still throws the error. If the line is deleted then Vite does not complain and actually renders the .wasm file in SSR context, but that has to be done by hand.
There should be an ability to ignore such lines and not throw a fatal error at compile time, and only throw the error at run time, if that line is somehow reached, because its demonstrated that the code actually works and its Vite being too harsh.
Reproduction

Download sveltekit-rust-ssr-template and its dependencies
npm install
npm run dev and exit
npm run build

Interestingly when trying SSR with npm run dev then it works sometimes but sluggishly.
System Info
System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 AMD Ryzen 7 4700U with Radeon Graphics
    Memory: 2.71 GB / 7.37 GB
  Binaries:
    Node: 16.0.0 - C:\Program Files\nodejs\node.EXE
    npm: 7.20.5 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 94.0.4606.61
    Edge: Spartan (44.19041.1023.0), Chromium (92.0.902.78)

Used Package Manager
npm
Logs
No response
Validations

[x] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
[X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
[X] The provided reproduction is a minimal reproducible example of the bug.

Does not reproduce anymore out of the blue

Managed to get reproduction working, reopening

Also from wasm-pack https://github.com/nshen/test-npm-crate/issues/1 .

Fixed by #7219


One more plugin error reporting  fix

Description
Caught one more lingering bug in the plugin error reporter since the move to napari-plugin-engine.  This PR fixes that one-liner here, and adds more tests to ensure full coverage on all error reporting stuff.
Type of change

[x] Bug-fix (non-breaking change which fixes an issue)

How has this been tested?

[x] all tests pass with my change

Final checklist:

[x] My PR is the minimum possible work for the desired functionality
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] I have added tests that prove my fix is effective or that my feature works

Note that added test is currently failing only on linux

man I love tests :) so useful!  fixed and added comments


Update sbt-debug-adapter to 4.2.0

About this PR
📦 Updates ch.epfl.scala:sbt-debug-adapter from 3.1.5 to 4.2.0 ⚠
📜 GitHub Release Notes - Version Diff
Usage
✅ Please merge!
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

⚙ Adjust future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "ch.epfl.scala", artifactId = "sbt-debug-adapter" } ]

Or, add this to slow down future updates of this dependency:
dependencyOverrides = [{
  pullRequests = { frequency = "30 days" },
  dependency = { groupId = "ch.epfl.scala", artifactId = "sbt-debug-adapter" }
}]

labels: sbt-plugin-update, early-semver-major, semver-spec-major, commit-count:1

Superseded by #148.


UP-4374 Gather release notes continually in source control

( UP-4374 ).
Human readable release notes add value in making it easier for uPortal adopters and others to understand broadly what is accomplished in a release and why to be excited about it, value beyond that available from the bare issue tables generated from the issue tracker.  Something like this serves a different purpose than something like this.
However, it is significant effort for a release engineer to take the time to write human-readable release notes, and he or she will often not be the person best positioned to understand off-hand the facts and significance of a particular change.
Proposed: start gathering draft Markdown release notes right in source control, so that these can be continually, collaboratively authored, updated in the very same commits and pull requests that make advances worth noting.  This will reduce the deferred, marginal effort to produce human-readable release notes for any given release and take more opportunity to articulate these release notes sooner while the change is fresh, on our minds, and while the developers making the change are handy.
This changeset creates a place to gather these release notes ( RELEASE_NOTES_DRAFT.md), seeds those with the release notes from uPortal 4.2.0-M1 so that we build upon and hone those for further releases towards 4.2.0, documents how to use the new file in the release process, and updates CONTRIBUTING.md to document the expectation that change sets going forward will offer updates to RELEASE_NOTES_DRAFT.md to accompany their functional changes.
If merged, as followup

[ ] Update the wiki instructions for Cutting a uPortal release to remind the release engineer to follow the steps documented in RELEASE_NOTES_DRAFT.md

I think the idea is sound and I'm happy to contribute to this strategy.  The release process is fairly burdensome (and thank you to all again who tirelessly slog through it!).  Obviously the Release Engineer will still need to do due diligence to insure nothing is missed (we are predictably error-prone us humans :smile: ).
However I suggest the file be called RELEASE_NOTES.md and the top of it have a statement of DRAFT and a bit of context that is removed during the release process.  Deleting and recreating files seems unnecessarily complicated to me and I'm not sure I see much advantage to it.  Why not just version the file that will become the official one?  For milestone releases we'll need to segregate what's different between each milestone release, but that can be done within the same file as well.

@jameswennmacher Good feedback.  Appreciated.  I'm sold on simplifying it to a running RELEASE_NOTES.md. I'll update this PR when time allows.

@apetro - update on this? should we close this and open another when time allows?

@apetro & @timlevett -- I also suggest closing and re-opening when the time is ripe.

On other projects we have had a lot of success using release notes in github. We should do that and close this.

Thanks @timlevett.  I am a supporter of this change in principal & spirit.  I believe this approach has a mandate in the community.  That said, I'll nevertheless close this PR and look forward to an update when one of us can get to it.


files_container_add_from_raw() failing with 'Access Denied'

Using SB 15.1 I'm able to use the safe_files_xxx APIs to obtain the contents of files and folders, but after authorising the app I can't add a file. Testing with SB 15.2 is not possible as the site does not load at all (see https://github.com/maidsafe/safe_browser/issues/1061).
     let filesContainer_get = this.safeJs.safeApi.files_container_get('safe://' + nrsName);
      console.log('files_container_get(safe://nrsName): ', JSON.stringify(filesContainer_get))

      let filesContainer_get2 = this.safeJs.safeApi.files_container_get(docUri);
      console.log('files_container_get(docUri): ', JSON.stringify(filesContainer_get2))

      let filesContainerData = this.safeJs.safeApi.files_container_add_from_raw(body, docUri, false, false, false);
      console.log('filesContainerData: ', JSON.stringify(filesContainerData))

The above code is fine until the call to files_container_add_from_raw() which gives the following error:
safenetworkjs:ldp Unable to create file 'safe://dublin-core/test3.txt' : Error: internal error in Neon module: Failed to add file form raw bytes to FilesContainer: NetDataError("Failed to PUT Published ImmutableData: CoreError(Access denied - CoreError::DataError -> AccessDenied)")

I wondered if I wasn't requesting the correct permissions but AFAIK there are no parameters for this currently and I'm seeing the same permission request as for safe auth in the authenticator UI:
The following application authorisation request was received:
+----------------------------------------------+-------------------+--------+------------------------+
| Id                                           | Name              | Vendor | Permissions requested  |
+----------------------------------------------+-------------------+--------+------------------------+
| https://github.com/otto-aa/solid-filemanager | solid-filemanager | A_A    | Own container: false   |
|                                              |                   |        | Default containers: {} |
+----------------------------------------------+-------------------+--------+------------------------+
Allow authorisation? [y/N]: y
Authorisation will be allowed...
Authorisation response sent

I'm not sure if this is a bug or if I'm doing something wrong.
Environment
Ubuntu 19.04

@theWebalyst you won't be able to mutate a FilesContainer using a second application, you can only do it with the application which created the FilesContainer, that's usually the case of those access denied errors. We still need to expose on APIs permissions for sharing content among apps


SparkMIDI is not building

Hello,
I am running into an issue building the Spark MIDI project. I am using SPARKMIDI15.ino and getting this error. Do you have any ideas about what I am doing wrong or what I need to install? I could build again with verbose error reporting if it helps.  I tried building for the WROOM module as well with the same results. I also receive the same results if I attempt to build v12.
Thank you for all of your help.
Arduino: 1.8.19 (Windows Store <IP_ADDRESS>) (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, Core 1, Core 1, None"

In file included from C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLECharacteristic.h:17,

                 from C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLEServer.h:20,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:7,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLEDescriptor.h:25:7: error: redefinition of 'class BLEDescriptor'

 class BLEDescriptor {

       ^~~~~~~~~~~~~

In file included from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLECharacteristic.h:25,

                 from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEService.h:23,

                 from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEDevice.h:25,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEDescriptor.h:28:7: note: previous definition of 'class BLEDescriptor'

 class BLEDescriptor {

       ^~~~~~~~~~~~~

In file included from C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLEServer.h:20,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:7,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLECharacteristic.h:53:7: error: redefinition of 'class BLECharacteristic'

 class BLECharacteristic {

       ^~~~~~~~~~~~~~~~~

In file included from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEService.h:23,

                 from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEDevice.h:25,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLECharacteristic.h:45:7: note: previous definition of 'class BLECharacteristic'

 class BLECharacteristic  {

       ^~~~~~~~~~~~~~~~~

In file included from C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLEServer.h:21,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:7,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLEService.h:49:7: error: redefinition of 'class BLEService'

 class BLEService {

       ^~~~~~~~~~

In file included from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEDevice.h:25,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEService.h:28:7: note: previous definition of 'class BLEService'

 class BLEService {

       ^~~~~~~~~~

C:~\Documents\Arduino\SparkMIDI15\SparkComms.ino: In member function 'virtual void CharacteristicCallbacks::onWrite(BLECharacteristic*)':

SparkComms:115:39: error: 'class BLECharacteristic' has no member named 'getValue'; did you mean 'setValue'?

     for (auto & it : pCharacteristic->getValue()) {

                                       ^~~~~~~~

                                       setValue

C:~\Documents\Arduino\SparkMIDI15\SparkComms.ino: In member function 'virtual void MIDICharacteristicCallbacks::onWrite(BLECharacteristic*)':

SparkComms:129:39: error: 'class BLECharacteristic' has no member named 'getValue'; did you mean 'setValue'?

     for (auto & it : pCharacteristic->getValue()) {

                                       ^~~~~~~~

                                       setValue

C:~\Documents\Arduino\SparkMIDI15\SparkComms.ino: In function 'bool connect_to_all()':

SparkComms:230:14: error: 'init' is not a member of 'BLEDevice'

   BLEDevice::init("Spark 40 MIDI BLE");

              ^~~~

SparkComms:231:27: error: 'createClient' is not a member of 'BLEDevice'

   pClient_sp = BLEDevice::createClient();

                           ^~~~~~~~~~~~

SparkComms:235:30: error: 'createClient' is not a member of 'BLEDevice'

   pClient_pedal = BLEDevice::createClient();

                              ^~~~~~~~~~~~

SparkComms:237:22: error: 'getScan' is not a member of 'BLEDevice'

   pScan = BLEDevice::getScan();

                      ^~~~~~~

SparkComms:239:24: error: 'createServer' is not a member of 'BLEDevice'

   pServer = BLEDevice::createServer();

                        ^~~~~~~~~~~~

SparkComms:244:39: error: 'class BLEService' has no member named 'createCharacteristic'; did you mean 'addCharacteristic'?

   pCharacteristic_receive = pService->createCharacteristic(S_CHAR1, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR);

                                       ^~~~~~~~~~~~~~~~~~~~

                                       addCharacteristic

SparkComms:244:88: error: 'PROPERTY_READ' is not a member of 'BLECharacteristic'

   pCharacteristic_receive = pService->createCharacteristic(S_CHAR1, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR);

                                                                                ^~~~~~~~~~~~~

SparkComms:244:123: error: 'PROPERTY_WRITE' is not a member of 'BLECharacteristic'

   pCharacteristic_receive = pService->createCharacteristic(S_CHAR1, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR);

                                                                                ^~~~~~~~~~~~~~

SparkComms:244:159: error: 'PROPERTY_WRITE_NR' is not a member of 'BLECharacteristic'

   pCharacteristic_receive = pService->createCharacteristic(S_CHAR1, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR);

                                                                                ^~~~~~~~~~~~~~~~~

SparkComms:245:36: error: 'class BLEService' has no member named 'createCharacteristic'; did you mean 'addCharacteristic'?

   pCharacteristic_send = pService->createCharacteristic(S_CHAR2, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY);

                                    ^~~~~~~~~~~~~~~~~~~~

                                    addCharacteristic

SparkComms:245:85: error: 'PROPERTY_READ' is not a member of 'BLECharacteristic'

   pCharacteristic_send = pService->createCharacteristic(S_CHAR2, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY);

                                                                                ^~~~~~~~~~~~~

SparkComms:245:120: error: 'PROPERTY_NOTIFY' is not a member of 'BLECharacteristic'

   pCharacteristic_send = pService->createCharacteristic(S_CHAR2, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY);

                                                                                ^~~~~~~~~~~~~~~

SparkComms:251:28: error: 'class BLECharacteristic' has no member named 'setCallbacks'

   pCharacteristic_receive->setCallbacks(&chrCallbacks_r);

                            ^~~~~~~~~~~~

SparkComms:252:25: error: 'class BLECharacteristic' has no member named 'setCallbacks'

   pCharacteristic_send->setCallbacks(&chrCallbacks_s);

                         ^~~~~~~~~~~~

SparkComms:254:52: error: no matching function for call to 'BLECharacteristic::addDescriptor(BLE2902*)'

   pCharacteristic_send->addDescriptor(new BLE2902());

                                                    ^

In file included from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEService.h:23,

                 from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEDevice.h:25,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLECharacteristic.h:91:8: note: candidate: 'void BLECharacteristic::addDescriptor(BLEDescriptor&)'

   void addDescriptor(BLEDescriptor& descriptor);

        ^~~~~~~~~~~~~

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLECharacteristic.h:91:8: note:   no known conversion for argument 1 from 'BLE2902*' to 'BLEDescriptor&'

SparkComms:264:39: error: 'class BLEService' has no member named 'createCharacteristic'; did you mean 'addCharacteristic'?

   pCharacteristicMIDI = pServiceMIDI->createCharacteristic(MIDI_CHAR, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR | BLECharacteristic::PROPERTY_NOTIFY);

                                       ^~~~~~~~~~~~~~~~~~~~

                                       addCharacteristic

SparkComms:264:90: error: 'PROPERTY_READ' is not a member of 'BLECharacteristic'

   pCharacteristicMIDI = pServiceMIDI->createCharacteristic(MIDI_CHAR, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR | BLECharacteristic::PROPERTY_NOTIFY);

                                                                                ^~~~~~~~~~~~~

SparkComms:264:125: error: 'PROPERTY_WRITE' is not a member of 'BLECharacteristic'

   pCharacteristicMIDI = pServiceMIDI->createCharacteristic(MIDI_CHAR, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR | BLECharacteristic::PROPERTY_NOTIFY);

                                                                                ^~~~~~~~~~~~~~

SparkComms:264:161: error: 'PROPERTY_WRITE_NR' is not a member of 'BLECharacteristic'

   pCharacteristicMIDI = pServiceMIDI->createCharacteristic(MIDI_CHAR, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR | BLECharacteristic::PROPERTY_NOTIFY);

                                                                                ^~~~~~~~~~~~~~~~~

SparkComms:264:200: error: 'PROPERTY_NOTIFY' is not a member of 'BLECharacteristic'

   pCharacteristicMIDI = pServiceMIDI->createCharacteristic(MIDI_CHAR, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR | BLECharacteristic::PROPERTY_NOTIFY);

                                                                                ^~~~~~~~~~~~~~~

SparkComms:269:24: error: 'class BLECharacteristic' has no member named 'setCallbacks'

   pCharacteristicMIDI->setCallbacks(&chrCallbacksMIDI);

                        ^~~~~~~~~~~~

SparkComms:271:51: error: no matching function for call to 'BLECharacteristic::addDescriptor(BLE2902*)'

   pCharacteristicMIDI->addDescriptor(new BLE2902());

                                                   ^

In file included from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEService.h:23,

                 from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEDevice.h:25,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLECharacteristic.h:91:8: note: candidate: 'void BLECharacteristic::addDescriptor(BLEDescriptor&)'

   void addDescriptor(BLEDescriptor& descriptor);

        ^~~~~~~~~~~~~

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLECharacteristic.h:91:8: note:   no known conversion for argument 1 from 'BLE2902*' to 'BLEDescriptor&'

SparkComms:276:13: error: 'class BLEService' has no member named 'start'

   pService->start();

             ^~~~~

SparkComms:278:17: error: 'class BLEService' has no member named 'start'

   pServiceMIDI->start();

                 ^~~~~

SparkComms:285:29: error: 'getAdvertising' is not a member of 'BLEDevice'

   pAdvertising = BLEDevice::getAdvertising(); // create advertising instance

                             ^~~~~~~~~~~~~~

SparkComms:286:42: error: 'class BLEService' has no member named 'getUUID'

   pAdvertising->addServiceUUID(pService->getUUID()); // tell advertising the UUID of our service

                                          ^~~~~~~

SparkComms:288:46: error: 'class BLEService' has no member named 'getUUID'

   pAdvertising->addServiceUUID(pServiceMIDI->getUUID()); // tell advertising the UUID of our service

                                              ^~~~~~~

C:~\Documents\Arduino\SparkMIDI15\SparkComms.ino: In function 'void app_write(byte*, int)':

SparkComms:396:27: error: 'class BLECharacteristic' has no member named 'notify'

     pCharacteristic_send->notify(true);

                           ^~~~~~

C:~\Documents\Arduino\SparkMIDI15\SparkComms.ino: In function 'void app_write_timed(byte*, int)':

SparkComms:410:27: error: 'class BLECharacteristic' has no member named 'notify'

     pCharacteristic_send->notify(true);

                           ^~~~~~

Multiple libraries were found for "BLEDevice.h"

 Used: C:~\Documents\Arduino\libraries\ArduinoBLE

 Not used: C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE

 Not used: C:~\Documents\Arduino\libraries\BLEPeripheral

exit status 1

'class BLECharacteristic' has no member named 'getValue'; did you mean 'setValue'?

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I'm guessing a Windows user?
Can you first check your temp Arduino build directory is completely empty? File / Preferences then open the 'More preferences can be edited directly in the file' and there might be an entry for build.path
build.path=C:\Users\Paul\Documents\ArduinoBuild
If there is, check this has no files at all in there.
If not, then create one because it make compiles much quicker.
Then try again

And can you paste the start of SparkMIDI15.ino like this:
//     | .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |    | .--------------. || .--------------. || .--------------. || .--------------. |
//     | |    _______   | || |   ______     | || |      __      | || |  _______     | || |  ___  ____   | |    | | ____    ____ | || |     _____    | || |  ________    | || |     _____    | |
//     | |   /  ___  |  | || |  |_   __ \   | || |     /  \     | || | |_   __ \    | || | |_  ||_  _|  | |    | ||_   \  /   _|| || |    |_   _|   | || | |_   ___ `.  | || |    |_   _|   | |
//     | |  |  (__ \_|  | || |    | |__) |  | || |    / /\ \    | || |   | |__) |   | || |   | |_/ /    | |    | |  |   \/   |  | || |      | |     | || |   | |   `. \ | || |      | |     | |
//     | |   '.___`-.   | || |    |  ___/   | || |   / ____ \   | || |   |  __ /    | || |   |  __'.    | |    | |  | |\  /| |  | || |      | |     | || |   | |    | | | || |      | |     | |
//     | |  |`\____) |  | || |   _| |_      | || | _/ /    \ \_ | || |  _| |  \ \_  | || |  _| |  \ \_  | |    | | _| |_\/_| |_ | || |     _| |_    | || |  _| |___.' / | || |     _| |_    | |
//     | |  |_______.'  | || |  |_____|     | || ||____|  |____|| || | |____| |___| | || | |____||____| | |    | ||_____||_____|| || |    |_____|   | || | |________.'  | || |    |_____|   | |
//     | |              | || |              | || |              | || |              | || |              | |    | |              | || |              | || |              | || |              | |
//     | '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |    | '--------------' || '--------------' || '--------------' || '--------------' |
//      '----------------'  '----------------'  '----------------'  '----------------'  '----------------'      '----------------'  '----------------'  '----------------'  '----------------'

//
// Spark MIDI
//
// Open source MIDI control for the Spark 40 amp from Positive Grid
// See    https://github.com/paulhamsh/SparkMIDI for more details
// Also   https://github.com/paulhamsh/Spark     for documentation on the API and the message format to the Spark amp
//

//Dependencies:
// NimBLE                          >=1.2.0 (last tested with 1.3.6)
// SSD1306 by Adafruit             >=2.3.0
// ESP32 Dev Module board          =2.0.4
// Heltec ESP32 Series Dev-boards  =0.0.5

// For ESP32 Dev Kit update the preferences for board managers to point to: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
// And load the latest board library - 2.0.2 when built on 23 Jan 2022
// This has the latest BLE code which has setMTU
// The Heltec WIFI does not have a library supporting setMTU so that is removed by the preprocessor conditional (in SparkComms)

// Select the BLE type
// -------------------
// if CLASSIC is defined, will compile with BLE stack which allows serial bluetooth
// - if not defined will use NimBLE which has no serial bluetooth
// it matters because Android Spark apps use serial bluetooth
// but BLE doesn't handle Spark disconnection well, whereas NimBLE does

#define CLASSIC

// Select the BLE devices you need
// -------------------------------
// if BLE_APP_MIDI is defined it will allow a BLE MIDI device to connect (much like the app)
// if BLE_CONTROLLER is defined it will search for a bluetooth controller (like Akai LPD8 Wireless or IK Multimedia iRig Blueboard)

#define BLE_APP_MIDI
#define BLE_CONTROLLER

// Select whether to use external OLED
// -----------------------------------
//#define OLED_ON

// Select the USB host device type
// -------------------------------
// USB_HOST is the generic MAX 2341 host
// USB_TRINKET is a Trinket M0 device programmed as a USB Host

//#define USB_HOST
//#define USB_TRINKET

// Select the ESP32 board type
// ---------------------------
// M5STICK, M5CORE2, ESP_DEVKIT, HELTEC_WIFI
// Don't forget to set your board type in Tools -> Board as well!!
//
// Allowed combinations are:
// M5STICK && USB_TRINKET
// M5CORE2 && USB_TRINKET
// M5CORE && USB_HOST  (the USB Host base from M5)
// ESP_DEVKIT && (USB_TRINKET || USB_HOST)  can be either - the only one with a circuit for both so far
// HELTEC_WIFI && USB_HOST
//
// OLED_ON is acceptable with all boards except HELTEC_WIFI

#define ESP_DEVKIT
//#define HELTEC_WIFI
//#define M5CORE
//#define M5CORE2
//#define M5STICK

Also check the board manager URL you are using.
Some sites say to use:
https://dl.espressif.com/dl/package_esp32_index.json
But I use:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
I have a feeling the first one had issues for me.
Though - if you are on v2.0.5 then you probably must be using the second one.

Thank you for your reply. I tried both 2.0.4 and 2.0.5. They both broke in the same place, so I must be using the second repo (thank you for including that in the instructions, it was helpful).  I am on Windows. I will check the other two pieces when I am at home. I do know that before I updated the IDE, I was using the other repo for my ESP32 Arduino projects, so the cache sounds like a plausible issue.
I apologize about all the confusion. I have only either built simple Arduino projects from scratch or used the Arduino or Adafruit libraries directly. In both situations, I only used one *.ino file and the library headers. Hence the confusion.
I am really excited about this project both in terms of learning a bit more about how Arduino libraries work, and about the end result. My amp has not even yet arrived, and I am already enthralled with the possibilities it offers.

I've just de-installed the IDE and re-installed 1.8.19.
Using the #defines in the code above, and using this board manager URL https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json, it all worked fine.
ESP32 Dev Module (bought from A-Z Delivery so ESP32-WROOM-32.
Also before re-installing I deleted everything from here:
C:\Users\Family\AppData\Local\Arduino15
Not sure if that matters.
I'm sure we'll crack it - it does sound odd.

Thank you for going through all of this to help me out. When you re-installed, did you add any other dependencies (though I am not using them, I added both the other Bluetooth library and the screen library from Adafruit, and now I wonder if the former could be the culprit)? I will check all of this evening, and I think clearing the cache will solve it. I will post back either way.

No, just the board library. To test it.
NimBLE shouldn't interfere, but it could be if that was triggered as well as the classic library - that would definitely have clashing definitions.
But...that shouldn't happen in the code, and doesn't for me
Try without NimBLE installed, then with it again.
Also check that #define CLASSIS is there
And perhaps get the code again (clone / download) to ensure there were no changes made in error - something could have triggered the BLE and non-BLE libraries.

Okay,
Major progress.
I built it and it seems to be working (I still do not have the Spark hardware, but the pedal comes tomorrow and the amp is supposed to arrive Friday :). The ESP32 works, and it seems I may not need to hard code too many terminal messages as the Debug messages are enough at least for the connection messages. If I need to, the switch statements are clear a clear access point for adding new messages (thank you for that).
I will put the beginning of the file below, but it is essentially the one you used.
So, the problem. I think what caused it was an old Bluetooth stack I used for my cheerlight. . I used a tiny pico to create one for my classroom. It is quite cool actually.
Anyway, I went through all the fixes above to no avail. However, I even though I did not have the cache folder you did, an old install did create a different one in my documents folder. I deleted that (and my old projects folder), uninstalled and reinstalled the IDE (V1.8.19), and it worked. Then, I reinstalled the NimBLE library just in case, and it still worked.
Thank you for all of your help. I am currently in business (well, awaiting the arrival of the other hardware).
This is really a cool project.
Here is the beginning of my file.
//       .----------------.  .----------------.  .----------------.  .----------------.  .----------------.      .----------------.  .----------------.  .----------------.  .----------------.
//     | .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |    | .--------------. || .--------------. || .--------------. || .--------------. |
//     | |    _______   | || |   ______     | || |      __      | || |  _______     | || |  ___  ____   | |    | | ____    ____ | || |     _____    | || |  ________    | || |     _____    | |
//     | |   /  ___  |  | || |  |_   __ \   | || |     /  \     | || | |_   __ \    | || | |_  ||_  _|  | |    | ||_   \  /   _|| || |    |_   _|   | || | |_   ___ `.  | || |    |_   _|   | |
//     | |  |  (__ \_|  | || |    | |__) |  | || |    / /\ \    | || |   | |__) |   | || |   | |_/ /    | |    | |  |   \/   |  | || |      | |     | || |   | |   `. \ | || |      | |     | |
//     | |   '.___`-.   | || |    |  ___/   | || |   / ____ \   | || |   |  __ /    | || |   |  __'.    | |    | |  | |\  /| |  | || |      | |     | || |   | |    | | | || |      | |     | |
//     | |  |`\____) |  | || |   _| |_      | || | _/ /    \ \_ | || |  _| |  \ \_  | || |  _| |  \ \_  | |    | | _| |_\/_| |_ | || |     _| |_    | || |  _| |___.' / | || |     _| |_    | |
//     | |  |_______.'  | || |  |_____|     | || ||____|  |____|| || | |____| |___| | || | |____||____| | |    | ||_____||_____|| || |    |_____|   | || | |________.'  | || |    |_____|   | |
//     | |              | || |              | || |              | || |              | || |              | |    | |              | || |              | || |              | || |              | |
//     | '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |    | '--------------' || '--------------' || '--------------' || '--------------' |
//      '----------------'  '----------------'  '----------------'  '----------------'  '----------------'      '----------------'  '----------------'  '----------------'  '----------------'

//
// Spark MIDI
//
// Open source MIDI control for the Spark 40 amp from Positive Grid
// See    https://github.com/paulhamsh/SparkMIDI for more details
// Also   https://github.com/paulhamsh/Spark     for documentation on the API and the message format to the Spark amp
//

//Dependencies:
// NimBLE               >=1.2.0 (last tested with 1.3.6)
// SSD1306 by Adafruit  >=2.3.0

// For ESP32 Dev Kit update the preferences for board managers to point to: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
// And load the latest board library - 2.0.2 when built on 23 Jan 2022
// This has the latest BLE code which has setMTU
// The Heltec WIFI does not have a library supporting setMTU so that is removed by the preprocessor conditional (in SparkComms)

// Select the BLE type
// -------------------
// if CLASSIC is defined, will compile with BLE stack which allows serial bluetooth
// - if not defined will use NimBLE which has no serial bluetooth
// it matters because Android Spark apps use serial bluetooth
// but BLE doesn't handle Spark disconnection well, whereas NimBLE does

#define CLASSIC

// Select the BLE devices you need
// -------------------------------
// if BLE_APP_MIDI is defined it will allow a BLE MIDI device to connect (much like the app)
// if BLE_CONTROLLER is defined it will search for a bluetooth controller (like Akai LPD8 Wireless or IK Multimedia iRig Blueboard)

#define BLE_APP_MIDI
#define BLE_CONTROLLER

// Select whether to use external OLED
// -----------------------------------
//  #define OLED_ON

// Select the USB host device type
// -------------------------------
// USB_HOST is the generic MAX 2341 host
// USB_TRINKET is a Trinket M0 device programmed as a USB Host

//#define USB_HOST
//#define USB_TRINKET

// Select the ESP32 board type
// ---------------------------
// M5STICK, M5CORE2, ESP_DEVKIT, HELTEC_WIFI
// Don't forget to set your board type in Tools -> Board as well!!
//
// Allowed combinations are:
// M5STICK && USB_TRINKET
// M5CORE2 && USB_TRINKET
// M5CORE && USB_HOST  (the USB Host base from M5)
// ESP_DEVKIT && (USB_TRINKET || USB_HOST)  can be either - the only one with a circuit for both so far
// HELTEC_WIFI && USB_HOST
//
// OLED_ON is acceptable with all boards except HELTEC_WIFI

#define ESP_DEVKIT
//#define HELTEC_WIFI
//#define M5CORE
//#define M5CORE2
//#define M5STICK

Glad it works - next step, with the amp!
Which pedal are you getting?

Definitely.
This is the one I am trying.

Thanks. Yes, those are great apps, and I am definitely going to do that.

Thank you for the help. Since it built, I am closing this issue.


Investigate @monokle/parser package

A new home for all models related to files, resources, CRDs, Helm and Kustomization. It also contains the logic for parsing these.
You can think about all the extractFiles, extractResources, etc logic.
On who does @monokle/parser depend :

Nobody. This package is the absolute foundation of the logic.

Who depends on @monokle/parser:

@monokle/validation
@monokle/ui
Monokle and Monokle Desktop

Threats:

This model has to work for Monokle and X. Does such a unified model exist?
This package should be decoupled, yet easy to integrate with Redux. We'd want helpers to update a resource and its file together to avoid problems with data integrity.
Circular dependency between parser and validation due to resource references. I believe a refactor to not put the references directly on the Resource is a prerequisite.

Remarks:

validation's NodeWrapper should also be moved here.

Duplicate of #473


Json logging

@mulaievaRH @apaplaus logs are successfully appearing in Splunk. Could you take a look when you have time


Accuracy of the network on the 50000 test images: 0.1%

Hello, the author, this is a very meaningful work. I encountered this accuracy problem when running the following code:
python -m torch.distributed.launch --nproc_per_node 8 main.py --cfg configs/22k_distill/tiny_vit_5m_22k_distill.yaml --data-path ./ImageNet --batch-size 128 --eval --resume ./checkpoints/tiny_vit_5m_22k_distill.pth --opts DATA.DATASET imagenet
Did I do something wrong?The dataset I use is ILSVRC2012. Is this what the project calls ImageNet?
On the other hand, I would like to ask how to evaluate it on a computer only with CPU?
Look forward to your reply, thank you!

Hi @DCBXZ66, thanks for your attention to our work.
ILSVRC2012 is ImageNet.
The command is correct. I run the same command and it outputs:
[2022-10-24 00:34:49 TinyViT-5M-22k-distill](utils.py 16): INFO ==============> Resuming form ./checkpoints/tiny_vit_5m_22k_distill.pth....................
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
[2022-10-24 00:34:49 TinyViT-5M-22k-distill](utils.py 34): INFO Convert checkpoint from 21841 to 1k
[2022-10-24 00:34:49 TinyViT-5M-22k-distill](utils.py 50): INFO <All keys matched successfully>
[2022-10-24 00:34:55 TinyViT-5M-22k-distill](main.py 468): INFO Test: [0/49]    Time 5.734 (5.734)      Loss 0.2961 (0.2961)    Acc@1 93.750 (93.750)   Acc@5 98.438 (98.438)   Mem 2001MB
[2022-10-24 00:34:59 TinyViT-5M-22k-distill](main.py 468): INFO Test: [10/49]   Time 0.442 (0.855)      Loss 0.9443 (0.7816)    Acc@1 80.469 (80.682)   Acc@5 92.969 (94.744)   Mem 2001MB
[2022-10-24 00:35:02 TinyViT-5M-22k-distill](main.py 468): INFO Test: [20/49]   Time 0.319 (0.593)      Loss 0.9976 (0.7569)    Acc@1 74.219 (81.138)   Acc@5 95.312 (95.647)   Mem 2001MB
[2022-10-24 00:35:05 TinyViT-5M-22k-distill](main.py 468): INFO Test: [30/49]   Time 0.305 (0.502)      Loss 1.1641 (0.8307)    Acc@1 71.875 (79.284)   Acc@5 88.281 (94.556)   Mem 2001MB
[2022-10-24 00:35:08 TinyViT-5M-22k-distill](main.py 468): INFO Test: [40/49]   Time 0.303 (0.454)      Loss 1.2490 (0.8959)    Acc@1 73.438 (77.668)   Acc@5 88.281 (93.979)   Mem 2001MB
[2022-10-24 00:35:11 TinyViT-5M-22k-distill](main.py 478): INFO  The number of validation samples is 50000
[2022-10-24 00:35:11 TinyViT-5M-22k-distill](main.py 480): INFO  * Acc@1 77.370 Acc@5 94.070
[2022-10-24 00:35:11 TinyViT-5M-22k-distill](main.py 158): INFO Accuracy of the network on the 50000 test images: 77.4%

Do other models even other codebases obtain the correct accuracy?

how to evaluate it on a computer only with CPU?

The code does not support evaluation with only CPU. It needs some modification to support it.

Hi @DCBXZ66, thanks for your attention to our work.
ILSVRC2012 is ImageNet.
The command is correct. I run the same command and it outputs:
[2022-10-24 00:34:49 TinyViT-5M-22k-distill](utils.py 16): INFO ==============> Resuming form ./checkpoints/tiny_vit_5m_22k_distill.pth....................
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
All checkpoints founded in output/TinyViT-5M-22k-distill/default: []
[2022-10-24 00:34:49 TinyViT-5M-22k-distill](utils.py 34): INFO Convert checkpoint from 21841 to 1k
[2022-10-24 00:34:49 TinyViT-5M-22k-distill](utils.py 50): INFO <All keys matched successfully>
[2022-10-24 00:34:55 TinyViT-5M-22k-distill](main.py 468): INFO Test: [0/49]    Time 5.734 (5.734)      Loss 0.2961 (0.2961)    Acc@1 93.750 (93.750)   Acc@5 98.438 (98.438)   Mem 2001MB
[2022-10-24 00:34:59 TinyViT-5M-22k-distill](main.py 468): INFO Test: [10/49]   Time 0.442 (0.855)      Loss 0.9443 (0.7816)    Acc@1 80.469 (80.682)   Acc@5 92.969 (94.744)   Mem 2001MB
[2022-10-24 00:35:02 TinyViT-5M-22k-distill](main.py 468): INFO Test: [20/49]   Time 0.319 (0.593)      Loss 0.9976 (0.7569)    Acc@1 74.219 (81.138)   Acc@5 95.312 (95.647)   Mem 2001MB
[2022-10-24 00:35:05 TinyViT-5M-22k-distill](main.py 468): INFO Test: [30/49]   Time 0.305 (0.502)      Loss 1.1641 (0.8307)    Acc@1 71.875 (79.284)   Acc@5 88.281 (94.556)   Mem 2001MB
[2022-10-24 00:35:08 TinyViT-5M-22k-distill](main.py 468): INFO Test: [40/49]   Time 0.303 (0.454)      Loss 1.2490 (0.8959)    Acc@1 73.438 (77.668)   Acc@5 88.281 (93.979)   Mem 2001MB
[2022-10-24 00:35:11 TinyViT-5M-22k-distill](main.py 478): INFO  The number of validation samples is 50000
[2022-10-24 00:35:11 TinyViT-5M-22k-distill](main.py 480): INFO  * Acc@1 77.370 Acc@5 94.070
[2022-10-24 00:35:11 TinyViT-5M-22k-distill](main.py 158): INFO Accuracy of the network on the 50000 test images: 77.4%

Do other models even other codebases obtain the correct accuracy?

how to evaluate it on a computer only with CPU?

The PR #136 supports CPU inference for TinyViT. It needs an extra argument --only-cpu.
python -m torch.distributed.launch --nproc_per_node 1 main.py --cfg configs/22k_distill/tiny_vit_5m_22k_distill.yaml --data-path ./ImageNet --batch-size 128 --eval --resume ./checkpoints/tiny_vit_5m_22k_distill.pth --only-cpu --opts DATA.DATASET imagenet

Thank you for your timely reply. I tried again and found the problem: val data in the tar package downloaded directly from ImageNet does not have a label folder, so it needs to be handled. After unzipping, I added a label folder to solve the problem of accuracy.
On the other hand, the "my_meter. py" file needs to be modified to run code on a PC with only CPU (and no cuda):
    def sync(self):
        # buf = torch.tensor([self._sum, self._count],
        #                    dtype=torch.float32).cuda()
        buf = torch.tensor([self._sum, self._count],
                           dtype=torch.float32)

@DCBXZ66 Great!
I will fix the bug in "my_meter.py". Thank you!

Close the issue since the issue has been resolved and the PR #136 has been merged.

Hi, @DCBXZ66, I have met the same problem with you. Same as you, I download the ImageNet dataset directly form the website, wihtout label folder. Could you teach me how to fix this by hand? How to download the val. label folder? Should I classify the images to different folders by the class label? Thank you very much!


build ADF lib for net45

build SDK for net45 to enable validation for IList and IDictionary elements

Hi @bgold09, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!

It looks like you're working at Microsoft (brgold). If you're full-time, we DON'T require a contribution license agreement.

If you are a vendor, or work for Microsoft Open Technologies, DO please sign the electronic contribution license agreement. It will take 2 minutes and there's no faxing! https://cla.azure.com.

TTYL, AZPRBOT;


Why is the value an empty string after resetting the menu?

Since value is string | undefined, I think that undefined should be the value when the menu of a Dropdown is reset, not an empty string. It makes no sense to me that "" indicates no value when the types clearly state that the value can be undefined. It's a way to get a bug without noticing it - someone might not expect an empty string to be passed to select, thinking that undefined is the value when nothing is selected. A user's code might then assume that a proper option with value set to "" was selected and throw an unexpected error because of that instead of discarding it as a non-value if it was undefined.

Should be fixed in v2.3.1


Streaming not working when routing between Runnables in LCEL

System Info
langchain_version: "0.0.306"
library: "langchain"
library_version: "0.0.306"
platform: "Windows-10-10.0.22621-SP0"
py_implementation: "CPython"
runtime: "python"
runtime_version: "3.9.0rc2"
sdk_version: "0.0.41"
Who can help?
@hwchase17
Information

[ ] The official example notebooks/scripts
[X] My own modified scripts

Related Components

[X] LLMs/Chat Models
[ ] Embedding Models
[ ] Prompts / Prompt Templates / Prompt Selectors
[ ] Output Parsers
[ ] Document Loaders
[ ] Vector Stores / Retrievers
[ ] Memory
[ ] Agents / Agent Executors
[ ] Tools / Toolkits
[ ] Chains
[ ] Callbacks/Tracing
[ ] Async

Reproduction
Streaming the response of a simple route created among 2 Runnables doesn't work. When I stream each Runnable independelty, it streams perfectly.
When I create a route for those Runnables to choose which one of them should be the next step, it doesn't stream the result.
Here's the example:
# ----------------- Runnable 1 -----------------

DEFAULT_DOCUMENT_PROMPT = PromptTemplate.from_template(template="{page_content}")
def _combine_documents(docs, document_prompt = DEFAULT_DOCUMENT_PROMPT, document_separator="\n\n"):
  doc_strings = [format_document(doc, document_prompt) for doc in docs]
  return document_separator.join(doc_strings)

def _format_chat_history(chat_history: List[Tuple]) -> str:
  buffer = ""
    for dialogue_turn in chat_history:
      human = "Human: " + dialogue_turn[0]
      ai = "Assistant: " + dialogue_turn[1]
      buffer += "\n" + "\n".join([human, ai])
  return buffer

_inputs = RunnableMap({
  "standalone_question": {
    "question": lambda x: x["question"],
    "chat_history": lambda x: _format_chat_history(x['chat_history'])
  } | PromptFactory.CONDENSE_QUESTION_PROMPT | ChatOpenAI(temperature=0, streaming=True) | StrOutputParser(),
})
_context = {
  "context": itemgetter("standalone_question") | vector_retriever | _combine_documents,
  "question": lambda x: x["standalone_question"]
}
Runnable1 = _inputs | _context | PromptFactory.PROMPT | ChatOpenAI(temperature=0, streaming=True)

# ----------------- Stream the response: -----------------

for s in Runnable1.stream({"question": "Hello!", "chat_history": []}):
  print(s, end="", flush=True)

The above stream works
# ----------------- Runnable 2 -----------------

Runnable2 = RunnableMap({
  "response": {
    "question": lambda x: x["question"],
    "chat_history": lambda x: _format_chat_history(x['chat_history']),
    "context": lambda x: QueriesContext.get_result()
  } | PromptTemplate.from_template(PromptFactory.followup_context_template) | ChatOpenAI(temperature=0, streaming=True) | StrOutputParser(),
})

# ----------------- Stream the response: -----------------

for s in Runnable2.stream({"question": "Hello!", "chat_history": [], "context": ['initialvalue']}):
  print(s, end="", flush=True)

The above stream also works
def get_result(text):
  return ["newvalue"]
router_chain = PromptTemplate.from_template(PromptFactory.router_template_test) | ChatOpenAI(temperature=0, streaming=True) | StrOutputParser()

def route(info):
  if "runnable1" in info["topic"].lower():
    return Runnable1
  elif "runnable2" in info["topic"].lower():
    return Runnable2
  else:
    raise Exception("Invalid topic")

full_runnable_router_chain = {
  "topic": router_chain,
  "question": lambda x: x["question"],
  "chat_history": lambda x: x["chat_history"],
  "context": lambda x: x["context"]
} | RunnableLambda(route)

# ----------------- Stream the response: -----------------

for s in full_runnable_router_chain.stream({"question": "Hello!", "chat_history": [], "context": ['initialvalue']}):
  print(s.content, end="", flush=True)

The above stream doesn't stream
Expected behavior
Stream from "full_runnable_router_chain"

I have tried the suggested modification and ran the same implementation without any changes to the original code posted. The Router Runnable outputs the response but it doesn't stream it.

RunnableLambda on functions returning Runnable doesn't support streaming yet. I've tested a subclass with streaming, it works for me, let me know how it goes for your case.
from typing import Optional, Any, Iterator, AsyncIterator

from langchain.callbacks.manager \
    import (CallbackManagerForChainRun, AsyncCallbackManagerForChainRun)
from langchain.schema.runnable import RunnableLambda, RunnableConfig, Runnable
from langchain.schema.runnable.config \
    import (patch_config,
            call_func_with_variable_args, acall_func_with_variable_args)
from langchain.schema.runnable.utils import Input, Output

class StreamingRunnableLambda(RunnableLambda):
    def _stream(
            self,
            input: Input,
            run_manager: CallbackManagerForChainRun,
            config: RunnableConfig,
    ) -> Iterator[Output]:
        output = call_func_with_variable_args(self.func, input, config, run_manager)

        # If the output is a runnable, invoke it
        if isinstance(output, Runnable):
            recursion_limit = config["recursion_limit"]
            if recursion_limit <= 0:
                raise RecursionError(
                    f"Recursion limit reached when invoking {self} with input {input}."
                )
            output = output.stream(
                input,
                patch_config(
                    config,
                    callbacks=run_manager.get_child(),
                    recursion_limit=recursion_limit - 1,
                ),
            )
        return output

    def stream(
            self,
            input: Input,
            config: Optional[RunnableConfig] = None,
            **kwargs: Optional[Any],
    ) -> Iterator[Output]:
        if hasattr(self, "func"):
            return self._call_with_config(
                self._stream,
                input,
                self._config(config, self.func),
            )
        else:
            raise TypeError(
                "Cannot invoke a coroutine function synchronously."
                "Use `astream` instead."
            )

Thank you @qtangs, I have not been able to make your example run correctly. Can you please share a working example?

Here you are :). This is an example adapted from your code, the most important change is to replace RunnableLambda with StreamingRunnableLambda:
if __name__ == '__main__':

    context = """
Following is a conversation between Clara, a climate advocate with a passion for environmental issues,
and Pam, a peace activist dedicated to fostering harmony among humans.

Clara: You know, Pam, it's been on my mind lately – the interconnectedness between human relationships
and our relationship with the environment.

Pam: Absolutely. I believe a peaceful world begins with understanding and respecting our interconnectedness,
not just with each other but with the planet we call home.

Clara: That's precisely why I find our discussions so enriching. Climate change isn't just
an environmental crisis; it's a reflection of how we relate to the world and each other.

Pam: It's fascinating how our treatment of the environment often mirrors our relationships.
When there's neglect, exploitation, or lack of care, problems arise. It's the same with human connections.
    """

    router_chain = ChatPromptTemplate.from_template(
        template=
        "Determine if this question is related for `Clara` or `Pam`: `{question}`."
        "Return only the final answer."
    ) | ChatOpenAI(temperature=0, streaming=True) | StrOutputParser()

    # ----------------- Runnable 1 -----------------
    Runnable1 = RunnableMap({
        "response":
            {
                "question": lambda x: x["question"],
                "context": lambda x: context,
            } | ChatPromptTemplate.from_template(
                template="Given the following context: \n{context}\n\n."
                         "Answer this as Clara, start with `According to Clara, `: {question}"
            ) | ChatOpenAI(temperature=0, streaming=True) | StrOutputParser(),
    })

    # ----------------- Runnable 2 -----------------
    Runnable2 = RunnableMap({
        "response":
            {
                "question": lambda x: x["question"],
                "context": lambda x: context,
            } | ChatPromptTemplate.from_template(
                template="Given the following context: \n{context}\n\n."
                         "Answer this as Pam, start with `According to Pam, `: {question}"
            ) | ChatOpenAI(temperature=0, streaming=True) | StrOutputParser(),
    })

    # ----------------- Router Chain -----------------
    def route(info):
        if "clara" in info["topic"].lower():
            return Runnable1
        elif "pam" in info["topic"].lower():
            return Runnable2
        else:
            raise Exception("Invalid topic: " + info["topic"])

    full_runnable_router_chain = \
        {
            "topic": router_chain,
            "question": lambda x: x["question"],
            "chat_history": lambda x: x["chat_history"],
            "context": lambda x: x["context"],
        } | StreamingRunnableLambda(route)

    # ----------------- Stream the response: -----------------
    for s in full_runnable_router_chain.stream({
        "question": "What did Clara say about human relationships and our relationship with the environment?",
        "chat_history": [], "context": ['initialvalue']
    }):
        print(s["response"], end="", flush=True)
    for s in full_runnable_router_chain.stream({
        "question": "What did Pam say about human relationships and our relationship with the environment?",
        "chat_history": [], "context": ['initialvalue']
    }):
        print(s["response"], end="", flush=True)

Here you are :). This is an example adapted from your code, the most important change is to replace RunnableLambda with StreamingRunnableLambda:
if __name__ == '__main__':

    context = """
Following is a conversation between Clara, a climate advocate with a passion for environmental issues,
and Pam, a peace activist dedicated to fostering harmony among humans.

Clara: You know, Pam, it's been on my mind lately – the interconnectedness between human relationships
and our relationship with the environment.

Pam: Absolutely. I believe a peaceful world begins with understanding and respecting our interconnectedness,
not just with each other but with the planet we call home.

Clara: That's precisely why I find our discussions so enriching. Climate change isn't just
an environmental crisis; it's a reflection of how we relate to the world and each other.

Pam: It's fascinating how our treatment of the environment often mirrors our relationships.
When there's neglect, exploitation, or lack of care, problems arise. It's the same with human connections.
    """

    router_chain = ChatPromptTemplate.from_template(
        template=
        "Determine if this question is for `Clara` or `Pam`: `{question}`."
        "Return only the final answer."
    ) | ChatOpenAI(temperature=0, streaming=True) | StrOutputParser()

    # ----------------- Runnable 1 -----------------
    Runnable1 = RunnableMap({
        "response":
            {
                "question": lambda x: x["question"],
                "context": lambda x: context,
            } | ChatPromptTemplate.from_template(
                template="Given the following context: \n{context}\n\n."
                         "Answer this as Clara, start with `According to Clara, `: {question}"
            ) | ChatOpenAI(temperature=0, streaming=True) | StrOutputParser(),
    })

    # ----------------- Runnable 2 -----------------
    Runnable2 = RunnableMap({
        "response":
            {
                "question": lambda x: x["question"],
                "context": lambda x: context,
            } | ChatPromptTemplate.from_template(
                template="Given the following context: \n{context}\n\n."
                         "Answer this as Pam, start with `According to Pam, `: {question}"
            ) | ChatOpenAI(temperature=0, streaming=True) | StrOutputParser(),
    })

    # ----------------- Router Chain -----------------
    def route(info):
        if "clara" in info["topic"].lower():
            return Runnable1
        elif "pam" in info["topic"].lower():
            return Runnable2
        else:
            raise Exception("Invalid topic: " + info["topic"])

    full_runnable_router_chain = \
        {
            "topic": router_chain,
            "question": lambda x: x["question"],
            "chat_history": lambda x: x["chat_history"],
            "context": lambda x: x["context"],
        } | StreamingRunnableLambda(route)

    # ----------------- Stream the response: -----------------
    for s in full_runnable_router_chain.stream({
        "question": "What did Clara say about human relationships and our relationship with the environment?",
        "chat_history": [], "context": ['initialvalue']
    }):
        print(s["response"], end="", flush=True)
    for s in full_runnable_router_chain.stream({
        "question": "What did Pam say about human relationships and our relationship with the environment?",
        "chat_history": [], "context": ['initialvalue']
    }):
        print(s["response"], end="", flush=True)

Thank you so much , this and the previous answer combined give a proper streaming response for runnableBranch thank you.

@qtangs  , could please provide a implementation of the astream method as well since currently astream is not working when I try to stream it via fastapi , but the stream method is working correctly.

@Talhavaival1, you can find the astream implementation in this PR: https://github.com/langchain-ai/langchain/pull/14794

Fixed in #14794


Wrong html element in footer

Instead of "diw" it should be a "div" tag in /themes/codefor-theme/layouts/partials/footer.html

#168


[BUG] Metadata sync won't start when recreating an AlluxioRuntime with a same name

What is your environment(Kubernetes version, Fluid version, etc.)
Fluid v0.4.0
Describe the bug
If I delete a AlluxioRuntime before its metadata synchronization process done and recreate one with the same name, the metadata sync process won't start.
This may lead to some problems like metadata synchronization won't start or the init image won't be re-setup.
What you expect to happen:
Metadata sync should start when I create an AlluxioRuntime
How to reproduce it

Create an AlluxioRuntime, bind it to some dataset.
Delete the AlluxioRuntime before metadata synchronization is done.
Recreate one with the same name.
Found that metadata synchronization won't start.

Additional Information

This may be the cause of this issue:
AlluxioRuntime controller maintains a map structure to record all the AlluxioEngine objects. However, it adds an AlluxioEngine object to the map with the key "<namespace>-<name>" while try to remove it with the key "<namespace>/<name>", which means the deletion is actually a no-op and the AlluxioEngine won't be removed when deleting the associated AlluxioRuntime
Metadata synchronization uses a channel defined in the AlluxioEngine object to get result asynchronously, under the circumstance where the AlluxioEngine will be reused instead of building a new one, the metadata synchronization won't start if a new AlluxioRuntime with the same name is created

I think the channel should be destroyed when engine.destroy() .


Add basic CSS caching to oranda

This PR adds a very naive caching implementation when fetching the pre-built CSS. This applies only to assets that would be fetched over the network.
For larger workspace projects, the blocking requests can add a significant amount of time:
Before:
✓ >o_o< SUCCESS: Your site builds are located in `public`.
oranda build  1.03s user 0.30s system 10% cpu 12.634 total

After:
✓ >o_o< SUCCESS: Your site builds are located in `public`.
oranda build  0.85s user 0.22s system 28% cpu 3.740 total

In the future, it may be desirable to cache this at the filesystem level (in .cache/ or similar), or to handle this in a more common way, such as in a consistent manner managed by axoasset.
Debatable design decisions:

Using a Vec instead of a HashMap:

This is pretty much just because Vec::new() is const and HashMap::new() isn't
I don't think we'll likely be troubled by O(n) vs O(1) lookup, particularly compared to a network request

Using expect() on Mutex poisoning rather than bubbling up the error:

We literally do nothing but read and push with the mutex locked
If the mutex is poisoned something has gone horrifically wrong

Feel free to close this if y'all aren't interested, but 3-4 second iteration times for me is nicer than 12-15 second iteration times.

Misc bonus I didn't realize while initially developing: This means that long running oranda dev builds only make a single network request. Verified with some extra tracing:
oranda dev
↪ >o_o< INFO: Found 88 paths to watch, starting watch...
↪ >o_o< INFO: Workspace detected, gathering info...
↪ >o_o< INFO: Building 29 workspace member(s)...