Remove outdated CN docs to be consistent with EN

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-PR-Builder/10459/
Test FAILed.

jenkins failure:
2020/07/10 19:25:20 Errors found in documentation markdown
  /tmp/docsCheck895688830/docs/cn/operation/Troubleshooting.md:
    66: relative link pointed to unknown file /cn/deploy/Running-Alluxio-on-EC2.html

need to remove link reference to deleted doc

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-PR-Builder/10462/
Test PASSed.

alluxio-bot, merge this please

alluxio-bot, cherry-pick this to branch-2.3 please


can't read webhook data

I've attached a webhook to my intent, the speech field is the one that gets returned from the webservice however the there is no data field on the response from the sdk.
When making a curl request I get the data object. Is this intended or am I doing something wrong how would I access this response field?
thank you

@pika11 Did you ever figure this out?

I am having this issue as well.  The data property is not being handled by the library, only the speech property.


FadeSlide transitioning

This pull request is an attempt to implement the missing FadeSlide transition; An animation where the current ViewController fades and then slides to the next ViewController.

@Tylerian We are noticing an issue with the animation. The view controllers are not stacked correctly, which is creating a black screen in the animation.

@Tylerian I haven't heard from you. I will close this PR, and when you like, please reopen it and we can work to integrate this feature into Motion. Thank you!

Even if the contentView can be updated color wise. Its position would need to be stacked appropriately with the view controller coming in / going out. Before this PR can be accepted, all parts would need to be completed.


Add AllLineNames, AllLineIMag, AllLineIPu and similar functions

Currently we have AllBusNames and AllBusVMag in Circuit but no AllLineNames and AllLineIMag. Users are using export currents to get a csv file and read the data back into Python / Julia. Maybe this is an upstream feature request, since I imagine this is not trivial to implement.

Should not be too complex, we can add it. For a future release/docs, it's important to mark those as extensions though.

Looking into the export and show commands, they include all PDElements. The currents can be in rectangular, polar and sequence forms/components. Some reports use NormAmps and EmergAmps (capacity reports).
Some could be implemented at the user level, but I agree that they're used enough that we should expose them directly, especially since not everything can be easily done with the current API and it could be error prone.
To simplify the functions names, I propose adding the new functions in the existing PDElements module, which is currently very limited.
Tentative list:

AllNames
AllCurrents
AllCurrentsMagAng
AllSeqCurrents
AllPowers
AllSeqPowers
AllCapacityNorm / AllCapacityEmerg, or a single AllCapacity with both values
AllNumPhases? Or maybe AllNumNodes, need to consider the terminals too, etc.

Naming not final but I tried to follow the convention from CktElement, which already contain most functions for individual elements, with the exception of capacity functions.

Following the naming convention from the other modules seems great!

AllNumPhases? Or maybe AllNumNodes, need to consider the terminals too, etc.

If we have a single phase Line is connected between a 3 phase bus and 2 phase bus, i.e. something like this:

What would AllNumPhases / AllNumNodes return?
I think we should set ourselves up to build graph structures to represent the circuit when the class based rewrite happens.

For your example, 2 phases times 2 terminals = 4 nodes total. For the current CktElement.Currents,
The issue is that both the number of nodes and terminals vary. Maybe listing the total number of nodes is enough, since most elements would be lines (2 terminals). For the exceptions, like transformers with 3 windings, it's probably easier to get the individual information from other functions.
I'll think a bit more about it. Some extra functions, like AllMaxCurrents, would be both useful for the users and easier to interpret.

I think we should set ourselves up to build graph structures to represent the circuit when the class based rewrite happens.

I have to finish 0.11 first (and 0.11 already contains some useful extras), and after that we should start planning a better API as a whole. As long as the official OpenDSS doesn't change drastically, we can keep the current API based on the active element concept for compatibility, while working on a better API (and better OpenDSS engine as whole).

This is done, just need to add tests to dss_python or ODD.py before the next release.

Awesome!

Relevant tests in https://github.com/dss-extensions/OpenDSSDirect.py/pull/85


Automatically focus newly created windows in an empty workspace

Description
New windows in empty workspaces should automatically be focused if follow_mouse=1
Currently windows open unfocused and it's necessary to move the mouse cursor a little bit

For me, new windows get the focus automatically when created in an empty workspace. What hyprland version are you using? Does this behavior always happen for you or only under some circumtances?

I just tested with a default config, the issue isn't present so it's probably my config that's causing the problem; I'm using hyprland 0.45 but I've had this config since 0.42 and the only things that have changed were the shadow options with the most recent hyprland update, and switching between different file managers
I'll just go ahead and re-write my config


mitmproxy doesn't work well on RHEL8

Problem Description
mitmproxy doesn't work well on RHEL8.
When I use localhost as proxy , it works well.
$ curl -x http://localhost:8880/ -i http://www.baidu.com
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
Connection: keep-alive
Content-Length: 2381
Content-Type: text/html
Date: Mon, 16 Aug 2021 01:59:44 GMT
Etag: "588604ec-94d"
Last-Modified: Mon, 23 Jan 2017 13:28:12 GMT
Pragma: no-cache
Server: bfe/<IP_ADDRESS>
Set-Cookie: BDORZ=27315; max-age=86400; domain=.baidu.com; path=/

But if I use my IP , it doesn't work
$ curl -x http://myip:8880/ -H 'Expect:' -iv http://www.baidu.com
* Rebuilt URL to: http://www.baidu.com/
*   Trying <IP_ADDRESS>...
* TCP_NODELAY set
* Connected to <IP_ADDRESS> (<IP_ADDRESS>) port 8880 (#0)
> GET http://www.baidu.com/ HTTP/1.1
> Host: www.baidu.com
> User-Agent: curl/7.61.1
> Accept: */*
> Proxy-Connection: Keep-Alive
>
* Empty reply from server
* Connection #0 to host <IP_ADDRESS> left intact
curl: (52) Empty reply from server

Steps to reproduce the behavior:

start mitmproxy using docker

docker run --rm --name dev01proxy -d -it -p 8880:8080 -p 8881:8081  mitmproxy/mitmproxy mitmweb --web-host <IP_ADDRESS> --set ssl_insecure=true

curl using localhost as proxy

curl -x http://localhost:8880/ -i http://www.baidu.com

curl using ip as proxy

curl -x http://myip:8880/ -H 'Expect:' -iv http://www.baidu.com

System Information
root@64e7c877fcc9:/# mitmproxy --version
Mitmproxy: 7.0.2
Python:    3.9.6
OpenSSL:   OpenSSL 1.1.1k  25 Mar 2021
Platform:  Linux-4.18.0-240.1.1.el8_3.x86_64-x86_64-with-glibc2.28

We just open a regular listening socket and do nothing fancy. I suspect this is a Docker networking problem, not a mitmproxy one?

@mhils I tried to install mitmproxy via pipx on RHEL, same error happened.
Is there any additional setting required on RHEL?
BTW, on MAC , every thins goes well

I don't really know anything about RHEL, sorry. 🤷♂


Loading preludes for various environments

There seem to be a few bugs with preludes. Preludes can be loaded for the default env by passing
--prelude <ml-file> or for a specific one by passing --prelude <env-name>:<ml-file>.
I would expect this to behave just as regular toplevel blocks would, ie the default environment is just a separate environment.
I ran into a weird bug where the default env seems to be contaminated by preludes loaded for other envs.
Another disturbing behaviour is that if I load the default env prelude last, it doesn't seem to be loaded at all.
I reproduced this behaviour in a draft PR here.
I belive this should be fixable as it seems that it all works well if only using named envs but I think it raises questions about the prelude, the envs and how they should behave. Should the default env preludes be loaded for every env? Just the default one?
I also think we should probably not allow more than one prelude per env (default one included) as otherwise we have to take the order of CLI arguments into account and that seems a bit odd.

The current behaviour seems to be that a default prelude is loaded for every env. That seems like a feature as I guess one might want to use that to register printers or define global variables for all envs so we should preserve that.

The bugs are fixed by #225


how to install it with lazyvim?

im kinda lazy to install it with vim-plug, and tho, lazyvim already installed on my neovim.

Hi, I just saw your comment. I just finished migrating part of this plugin to lua, so there are new installation instructions now
https://github.com/stsewd/spotify.nvim?tab=readme-ov-file#installation


Make CDF5 support a configure time option.

Due to some issues centered around CDF5, it would be convenient to have a way to disallow cdf5 support altogether while these are being resolved.

[ ] Create cdf5-optional branch from 4.5.0-release-branch
[ ] Make cdf5 optional at configure time.

[ ] autoconf
[ ] cmake

[ ] Update tests so that cdf5 tests run only if CDF is enabled.
[ ] Merge cdf5-optional into 4.5.0-release-branch
[ ] Propagate changes into gh478

Mostly finished, just need to figure out why netcdf4-classic nc_test is failing on nc_set_default_format().


(bug) Support Case:Sign in with Facebook on android beta opens a new wallet

the user was unable to login with his Facebook login however to the web app he was able to enter. the beta app prompts him to create a new account
Expected result: User should be able to login with Facebook account on React Native app
extra data:
when you reload the page, what is the version number that you see?: 1.27.1
What device was used? I use sony xz2
What was the operating system? Android 10
Browser: Chrome WebView 90.0.4430.91 on Android 10

@iLystopad can you try to reproduce please

@omerzam I cannot reproduce this issue. I tried to log in with different Facebook accounts and it was logging in without issues.
Unfortunately, I don't have the Sony xz2, I checked it on the Xiaomi Mi8 with Android version 9 and Honor with android version 10.
Also, I tried to install Chrome Webview 90.0.4430.91 but the Gooddollar app is crashed after launching
Checked on the Android App Version 1.27.1 (1486)
Devices: Xiaomi Mi8 // Android 9
Honor 20 // Android 10

@omerzam I cannot reproduce this issue. I tried to log in with different Facebook accounts and it was logging in without issues.
Unfortunately, I don't have the Sony xz2, I checked it on the Xiaomi Mi8 with Android version 9 and Honor with android version 10.
Checked on the Android App Version 1.27.1 (1486)
Devices: Xiaomi Mi8 // Android 9
Honor 20 // Android 10

did you always get the same wallet with both webapp and react native for a specific Facebook account?

@omerzam i got the same wallet address all time after login and after signing up with the same Facebook accounts, even when deleting an account and then sign up again on the android app - got the same address
Checked on the web app Prod 1.27.1
Android app 1.27.1 (1486)
Attachment: https://www.screencast.com/t/Mh5uPJSF7

that's the expected behaviour also in the web wallet.
there's 1-1 connection between google email->private key, facebook id ->
private key, phone number->private key

@omerzam @iLystopad
do we have anything new about this? any examples from support?
otherwise close it


feat: add opentelemetry BOM

Issue
https://gravitee.atlassian.net/browse/APIM-5276

Gravitee.io Automatic Deployment
🚀 A prerelease version of this package has been published on Gravitee's private artifactory, you can:

use it directly by updating your project with version: 8.1.0-APIM-5276-otel-SNAPSHOT
download it from Artifactory here

:tada: This PR is included in version 8.1.0 :tada:
The release is available on:

8.1.0
GitHub release

Your semantic-release bot :package::rocket:


Incorrect sample code in Readme.md

Line 148 is clearly a cut/paste error from the ObjC code into the Swift example.

Closing the issue for now. please reopen if you have any other questions or concerns!


Add ELSH custom axis

PR to follow up on the inclusion of the new custom axis ESHP https://github.com/googlefonts/axisregistry/issues/15

This needs images before merging, and description check with Sarah.

Display name + Tag under revision #78

https://github.com/googlefonts/axisregistry/pull/78#issuecomment-1261142617

Merged to google/fonts main in https://github.com/google/fonts/pull/5333

Let's move this axis registration to production so that we can prepare for the Handjet sandbox push.
https://github.com/google/fonts/pull/5426#discussion_r997718157


[22:09:38] [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\level\generator\Generator::addGenerator()" (EXCEPTION) in "MyPlot-1.2.5/src/MyPlot/MyPlot" at line 516

[x] This issue isn't duplicated - you can check if it is by using the search bar located at the top left hand corner and select "Issues" on the left.
[x] This issue includes appropriate markdown for sections - e.g. code blocks for crash dumps.
[x] This issue is understandable - feel free to use your native language to write issues if you are not comfortable with English.

Issue description
What problem do you have?
plugin disable with error [22:09:38] [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\level\generator\Generator::addGenerator()" (EXCEPTION) in "MyPlot-1.2.5/src/MyPlot/MyPlot" at line 516

Reproducing the issue

...use latest verion of myplot
...add to pocketmine server using 3.0.0 api

Client information
PocketMine-MP Version:  https://github.com/pmmp/PocketMine-MP/commit/56b04fa0bb6bfab86712f03f6e001b918065abe0
Plugin Version: version: 1.2.5
PHP version: 7.2.1 (default)

Optional information
Put a console error here

[22:09:38] [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\level\generator\Generator::addGenerator()" (EXCEPTION) in "MyPlot-1.2.5/src/MyPlot/MyPlot" at line 516
[22:09:38] [Server thread/DEBUG]: #0 src/pocketmine/plugin/PluginManager(204): MyPlot\MyPlot->onLoad()
[22:09:38] [Server thread/DEBUG]: #1 src/pocketmine/plugin/PluginManager(364): pocketmine\plugin\PluginManager->loadPlugin(string C:\Users\arjxy\Desktop\pocketmine\plugins\MyPlot-1.2.5, array Array())
[22:09:38] [Server thread/DEBUG]: #2 PocketMine-DevTools.phar/src/DevTools/DevTools(49): pocketmine\plugin\PluginManager->loadPlugins(string C:\Users\arjxy\Desktop\pocketmine\plugins\, array Array())
[22:09:38] [Server thread/DEBUG]: #3 src/pocketmine/plugin/PluginBase(102): DevTools\DevTools->onEnable()
[22:09:38] [Server thread/DEBUG]: #4 src/pocketmine/plugin/PluginManager(618): pocketmine\plugin\PluginBase->setEnabled(boolean 1)
[22:09:38] [Server thread/DEBUG]: #5 src/pocketmine/Server(1928): pocketmine\plugin\PluginManager->enablePlugin(DevTools\DevTools object)
[22:09:38] [Server thread/DEBUG]: #6 src/pocketmine/Server(1914): pocketmine\Server->enablePlugin(DevTools\DevTools object)
[22:09:38] [Server thread/DEBUG]: #7 src/pocketmine/Server(1649): pocketmine\Server->enablePlugins(integer 0)
[22:09:38] [Server thread/DEBUG]: #8 src/pocketmine/PocketMine(237): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string C:\Users\arjxy\Desktop\pocketmine\, string C:\Users\arjxy\Desktop\pocketmine\plugins\)
[22:09:38] [Server thread/DEBUG]: #9 C:/Users/arjxy/Desktop/pocketmine/PocketMine-MP.phar(1): require(string phar://C:/Users/arjxy/Desktop/pocketmine/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
[22:09:38] [Server thread/CRITICAL]: Could not load plugin 'MyPlot'

https://poggit.pmmp.io/p/MyPlot/1.2.6


Add DOM questions / answers

Create a new deck titled 'Javascript: DOM' - and add questions and answers (no limit on # really) that might test DOM manipulation-related concepts and mimic questions that might be asked in phone screens. Should be concise enough to fit into 1-2 sentences. Fill in here and submit pull request.
Some potential references for inspiration:

http://www.thatjsdude.com/interview/dom.html

@papistan  i will be working on this.

@papistan shall i work on this?

@geekychaser yes thanks!


Handle experimental opt ins

See #3395

[x] remove 2 instances of ExperimentalUnsignedTypes, and ExperimentalCoroutinesApi on ApolloClient.executeAsFlow (no impact)
[x] refact NSURLSessionWebSocketEngine / OkHttpWebSocketEngine to avoid invokeOnClose, then remove annotation
[x] refact WebSocketNetworkTransport.execute to avoid transformWhile, then remove annotation
[ ] Apple's DefaultDispatcher relying on Delay: not sure what to do!

Re: Delay, could we use Dispatchers.Main instead? It wasn't in the coroutines artifact for a while but maybe it's in 1.5.2 now ? Or in the -mt version?

Re: Delay, could we use Dispatchers.Main instead? It wasn't in the coroutines artifact for a while but maybe it's in 1.5.2 now ? Or in the -mt version?

So I played around with this and Dispatchers.Main does exist and works when using the -mt version. (Without -mt, native tests crash with kotlin.IllegalStateException: There is no event loop. Use runBlocking { ... } to start one.).
Now I must admit I'm not well versed enough in KMP to appreciate the full extent / subtitles of what this means - can we "just" use -mt? 😅 So far I didn't find many resources explaining the drawbacks of doing so (except it should no longer be needed when the new memory model will be stable, and "memory leaks in some concurrent execution scenarios").

We historically tried to avoid the -mt version of coroutines for all the reasons that your mention (memory leaks?, compatibility issues?, other?).
If there's no way around this then I guess we're stucked with @OptIn(InternalCoroutinesApi) and the day it crashes release an update. I think that wouldn't be the first time a K/N lib would have an incompatibility with kotlinx.coroutines

The good news is that

it's the only case of using this OptIn (albeit it's on an "important" class 😅)
hopefully we'll be able to get rid of it "soon"

We "just" have to enable the new memory model 🙈

Added a paragraph about this topic in Contributing.


Endpoint security > Attack surface reduction > New Policy

The page directs the creation of a new "Web protection profile" in MEM; but this profile type is not available
"
Go to the Microsoft Endpoint Manager admin center (https://endpoint.microsoft.com/), and sign in.
Choose Endpoint security > Attack surface reduction, and then choose + Create policy.
Select a platform, such as Windows 10 and later, select the Web protection profile, and then choose Create.
"
Please advise on the proper way to create a web protection profile, and update documentation.
See attached image:

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: a4489c89-f34a-b0d5-4e6d-edbe29e6d4e6
Version Independent ID: 6587d8f8-855e-8e8d-1e8a-f34492825d54
Content: Protect your organization against web threats
Content Source: microsoft-365/security/defender-endpoint/web-threat-protection.md
Product: m365-security
Technology: mde
GitHub Login: @Dansimp
Microsoft Alias: dansimp

@aaronnavratil Thank you for your feedback. I tested this in a couple of tenants and was not able to reproduce the issue as I see the options mentioned in the document.

I'd recommend you to contact Microsoft support via the need help option on the admin center to file a bug or fix the problem with your M365 tenant.
Hope this helps!
Thanks
Sri

@msbemba Thank you very much for the contribution and sharing this explanation. @aaronnavratil Hope this comment is helpful for you. Considering the nature of the issue, as advised, please open a service ticket in your tenant and follow with them for the resolution. We proceed to close it as here we are limited to documentation fixes and improvements only.
We will be very happy if you can share the outcome or resolution with us if you see documentation update is required. We will certainly update this documentation with that valuable information. Thanks again, for taking out some time to open the issue. Appreciate and encourage you to do the same in future also.


[Android] push message from SMC doesn't appear even though FCM from Firebase can be shown.

Thank you for your great work.
as is
Push messages from SMC doesn't be shown in Android.
Even though push messages from Firebase console is shown as head-up notification.
(For iOS, this plugin works fine. Show the push message in head-up notification.)
to be
Push messages from SMC is shown as head-up notification like from firebase console.
logs in console
When got the message from SMC, the following line is shown :
D/FLTFireMsgReceiver( 8926): broadcast received for message.
reproduce procedure

Init SMC SDK and setContactKey works fine.  SMC show the user with Firebase Token.

Open firebase console by Web browser.

Send test message to flutter application.

Check the head-up notification.

Both foreground / background, message is shown in head-up.

Console log is shown as follows:
D/FLTFireMsgReceiver( 8926): broadcast received for message
W/FirebaseMessaging( 8926): Missing Default Notification Channel metadata in AndroidManifest. Default value will be used.

Next, open SMC Mobile push page and create message

Send message to flutter application

Nothing happens
D/FLTFireMsgReceiver( 8926): broadcast received for messag

Would you please let me know any possible solutions?

Now I know that the issue is complex.
What I did in my flutter code is...

follows the instruction
In my flutter code, use FlutterLocalNotificationsPlugin to show the head message.
SF's push is not "notification" but "data".  So I get the data from "data" and I can see the head message.

The main issue is that Salesforce SDK doesn't show the head message by itself.
And also, this is important, Salesforce doesn't track open the push message or not.
Needless to say, the setAnalyticsEnabled(true) is set (SDK's default)
What is the main issue for this?

Now I understand the situation.
I needed to implement handler for Android. And now my app can show push message from SMC.
Just a log for future user like me:

Push message from SMC is a data message. Not notification.
Do NOT need to implement in Flutter. SMC is just a native SDK
To check the situation, getSdkState() is helpful and hadleMessage() is needed.

Thank you for this plugin!

I am having trouble integrating this plugin with FCM. Maybe i'm missing something but don't i need do set the fcm token somehow on the salesforce? I found no method to do that.

Thanks @rodrigobastosv but not that exactly. I'm looking for solving the issue of SFMC not sending a notification payload on their Notifications. By not doing that, background notifications on Android are not working as expected.

hi @alexdriba  and @rodrigobastosv
Yes, I added local notification in my flutter app and Background message is shown correctly.
Just fyi,  I used FlutterLocalNotificationsPlugin to implement local notification.


Allocation Issues

There are a handful of bugs that exist when using the project page to allocate votes.
On the pop-up modal when clicking Edit Distribution, then typing a non-number, the field will display NaN.  You can delete out the NaN and continue, but if you leave the NaN and click Save, the main allocation bar fills up and displays a NaN.  NaN is also displayed on the OP Allocated area of the project page.  If you edit distribution again and choose a regular number, then allocated votes returns to normal.

When adding a project to the ballot, then choosing any number (other than 1), the votes will appear in the red allocation bar, but the red Op Allocated section will display a 1.  Then clicking back into the Edit Distribution button also shows a 1.

Similar to the above, the modal for the Add To Ballot and Edit Distribution needs to be locked to only allow the max allocation.  In our case that is 100.  There is very sporadic behavior if numbers higher than 100 are entered.  It should allow a max of (current allocated votes + number entered in modal).

I'll work on this

Issue closed

Fixed in #90


Updating bucket name to the same name results in error

There was, probably, a recent change in influxdb since one of the litmus update buckets tests started failing. Before, the update was successful.  influxdb@master a1ed6e3cecc16fa1e931dc97d80f43b28faabf40
If it is a change in functionality, please let me know and I will update the test.

Create an org:

requests.post('http://localhost:9999/api/v2/orgs',  data {"name":"test_org_name_already_exists","status:":"active"}

create a bucket for the above org:

requests.post('http://localhost:9999/api/v2/buckets, data={"name":"test_bucket_name_already_exists", "retentionRules": [{"type":"expire","everySeconds":3600}], "organizationID": "03828e1d49a26000"})

update created bucket with the same name:

requests.post('http://localhost:9999/api/v2/buckets/03828e1d4b226000, data={"name":"test_bucket_name_already_exists", "retentionRules": [{"type":"expire","everySeconds":3600}]})

Request will return an error:

{
  "message": "bucket name is not unique",
  "code": "conflict"
}

yeah, the change is related to this issue https://github.com/influxdata/influxdb/issues/12381

I am going to update the test to handle the error in the case when bucket is being updated to its own name.

@kelwang, I can successfully run the above scenario without getting an error:
bucket name is not unique

Is it a change?


Investigate Faster lookaheads functions using runtime code generation.

Attempt to generate switch case statements instead of using object maps / loops to find the alternatives, basically generate  a DFA.
Must be possible to disable this as code generation at runtime does not work in some security contexts.
Disabling this must also be possible indirectly (I.E via some env variable) to support the transitive dependency use case.

This does not seem to be significantly faster (maybe 1-2%) in the most common case
of a single token lookahead (K=1). Does not seem to be worth the trouble of Content Security Policy issues due to usage of Function constructor (NO-EVAL)


Fix double-accounting for struct pldm_msg_hdr in getPresentStateBySensorReadigs()

Removing the size of struct pldm_msg_hdr from the buffer size is already accounted for in pldmd/pldmd.cpp:processRxMsg().
The double accounting leads to a failure to decode the message in libpldm as the buffer appears too short. With assertions enabled in libpldm (as it's currently not feasible to disable them) we arrive at the following abort and (abbreviated) backtrace:
    Program terminated with signal SIGABRT, Aborted.
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=<optimized out>) at pthread_kill.c:44
    44      pthread_kill.c: No such file or directory.
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=<optimized out>) at pthread_kill.c:44
    #1  0x76403a14 in __GI_raise (sig=sig@entry=6) at /usr/src/debug/glibc/2.36-r0/sysdeps/posix/raise.c:26
    #2  0x763ee100 in __GI_abort () at abort.c:79
    #3  0x763fcd34 in __assert_fail_base (fmt=0x20 <error: Cannot access memory at address 0x20>, assertion=0x76cd70c0 "ctx->remaining >= 0",
        assertion@entry=0x76cd708c "/usr/src/debug/libpldm/0.2.0+git999-r1/src/msgbuf.h",
        file=0x76cd708c "/usr/src/debug/libpldm/0.2.0+git999-r1/src/msgbuf.h", file@entry=0x20 <error: Cannot access memory at address 0x20>,
        line=line@entry=188, function=0x76cd75b8 <__PRETTY_FUNCTION__.11.lto_priv.0> "pldm_msgbuf_extract_uint8", function@entry=0x76f06e80 "")
        at assert.c:92
    #4  0x763fcdd8 in __GI___assert_fail (assertion=0x76cd708c "/usr/src/debug/libpldm/0.2.0+git999-r1/src/msgbuf.h",
        file=0x20 <error: Cannot access memory at address 0x20>, line=line@entry=188, function=0x76f06e80 "") at assert.c:101
    #5  0x76cc6998 in pldm_msgbuf_extract_uint8 (dst=<optimized out>, ctx=<optimized out>)
        at /usr/src/debug/libpldm/0.2.0+git999-r1/src/msgbuf.h:188
    #6  0x76cc95e0 in pldm_msgbuf_extract_uint8 (dst=<optimized out>, ctx=<optimized out>)
        at /usr/src/debug/libpldm/0.2.0+git999-r1/src/msgbuf.h:63
    #7  decode_get_state_sensor_readings_resp (msg=<optimized out>, payload_length=<optimized out>, completion_code=<optimized out>,
        comp_sensor_count=<optimized out>, field=0x7edfb5e4) at /usr/src/debug/libpldm/0.2.0+git999-r1/src/platform.c:796
    #8  0x76e20adc in pldm::HostPDRHandler::getPresentStateBySensorReadigs(unsigned char const&, unsigned short, unsigned short, unsigned short, unsigned short, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned short)::{lambda(unsigned char, pldm_msg const*, unsigned int)#1}::operator()(unsigned char, pldm_msg const*, unsigned int) const [clone .constprop.0] (
        __closure=0x2459a20, response=0x20cf93a, respMsgLen=6)
        at /usr/src/debug/pldm/1.0+gitAUTOINC+14305952d9-r1/host-bmc/host_pdr_handler.cpp:1508
    ...

Due to optimisations the line called out in frame 7 is not correct. Instead execution has moved beyond extraction of the completion code and into extraction of the sensor reading data. However, the payload length passed to decode_get_state_sensor_readings_resp() claims the buffer terminates before the last required field of the sensor reading data, giving rise to the assertion.
Tested: Booted a p10bmc system with the patch applied, plus a
downstream patch rebased on openbmc/libpldm@5dc025719dc3 ("pdr:
Add pldm_pdr_find_container_id_range_exclude() API")
Change-Id: I8c9d610ff7c96d63061f3d9d1437035a8da5bfa5

Can one of the admins verify this patch?

Andrew, the test case written will also be wrong right? Do we need to change that too..

https://github.com/ibm-openbmc/pldm/blob/699fe489eccbdb81138c5991c24759621e00d93e/libpldm/tests/libpldm_platform_test.cpp#L626
https://github.com/ibm-openbmc/pldm/blob/699fe489eccbdb81138c5991c24759621e00d93e/libpldm/tests/libpldm_platform_test.cpp#L652
https://github.com/ibm-openbmc/pldm/blob/699fe489eccbdb81138c5991c24759621e00d93e/libpldm/tests/libpldm_platform_test.cpp#L677

add to approvelist

Hi @Pavithrab7

Andrew, the test case written will also be wrong right? Do we need to change that too..
* https://github.com/ibm-openbmc/pldm/blob/699fe489eccbdb81138c5991c24759621e00d93e/libpldm/tests/libpldm_platform_test.cpp#L626

* https://github.com/ibm-openbmc/pldm/blob/699fe489eccbdb81138c5991c24759621e00d93e/libpldm/tests/libpldm_platform_test.cpp#L652

* https://github.com/ibm-openbmc/pldm/blob/699fe489eccbdb81138c5991c24759621e00d93e/libpldm/tests/libpldm_platform_test.cpp#L677

It's not clear to me why you're linking to libpldm test cases in a commit from February where libpldm was still integrated into the pldm repository. That's now no-longer relevant.
A crucial point here is that the cases you've linked to are test cases for libpldm. It's not the decode function in libpldm that's broken. The bug is entirely contained within the pldmd source code, because it's pldmd that's doing the double accounting. By that reasoning, the libpldm test cases are fine as they are not part of the pldmd code.
That said, I think the libpldm APIs could do with some improvement. The fact that the caller has to do some buffer size accounting before invoking the decode function is asking for trouble, and trouble is exactly what we received. We should rework the libpldm APIs so this accounting by the caller is not required, but that's a long road.


DBConnection and Pooling

Oops, my code is using the with keyword from Elixir 1.3. Which doesn't compile with your Travis-CI integration using version 1.1.

Go ahead and update travis.yml to use 1.3.
I don't think it's an unreasonable ask.

Are there any benefits for using [active: :once] over [active: true]? If we poll every time we receive a message.

Understanding how TCP works is important here.
Assume we used active: true. The db sends data to us over TCP. The OS networking layer receives that data, informs the OS process listening on that socket (BEAM) that data is available and buffers the data. BEAM then accepts the data (clearing the OS buffer) and sends it to our process and the data is buffered in the process mailbox. What happens if we can't process the data fast enough? The process mailbox grows.
Now let's look at active: :once. The db sends data to us over TCP. The OS networking layer receives that data, informs the OS process listening on that socket (BEAM) that data is available and buffers the data. BEAM now checks to see if the process owning that socket is active. If it is, it receives the data (clearing the OS buffer) and sends it to that process. if it is not active, it lets the data sit in the OS buffer. If the OS buffer is full, the OS will stop acking packets over TCP, and the DB will stop sending them. Which is exactly how TCP is supposed to work.
TLDR active: :once provides back pressure.

That is a really good explanation 👍.
I was wondering as I'm trying to implement a GenStage for a Twitter stream in an other project.
Did not know that active: true would result in back pressuring at the TCP level. This is really nice!

Did not know that active: true would result in back pressuring at the TCP level. This is really nice!

Just to be clear active: :once back pressures at the TCP level.

Sorry, I meant to write :once 😅.

@almightycouch What's needed to get this in a mergeable state?

Fix/modify failing, missing  connection tests. Check (DBConnection backoff options and pool specific options).
Add  tests for :poolboy and :sbroker (I've nevers tested the latter).
Query responses, especially errors should work as excepted. Not sure if this is always the case with the new {:ok, rep}, {:error, error} API.

I'm currently traveling through eastern Europe and will be back home in september. Feel free to make changes and refactor in the mean time.

Fix/modify failing, missing  connection tests. Check (DBConnection backoff options and Pool specific options).
Add  tests for :poolboy and :sbroker (I've nevers tested the latter).
Query responses, especially errors should work as excepted. Not sure if this is always the case with the new {:ok, rep}, {:error, error} API.

I'm currently traveling through eastern Europe and will be back home in september. Feel free to make changes and refactor in the mean time.

Also

By default the DBConnection provides a single connection. However the :pool option can be set to use a pool of connections. If a pool is used the module must be passed as an option - unless inside a run/3 or transaction/3 fun and using the run/transaction connection reference (t).

I think, my implementation is a unpleasant hack:
def __pool__(conn) do
    info =
      unless is_pid(conn) do
        Process.whereis(conn)
      else
        conn
      end
      |> Process.info(:dictionary)
    {pool, _, _} = elem(info, 1)[:"$initial_call"]
    case pool do
      :poolboy ->
        DBConnection.Poolboy
      _ ->
        DBConnection.Connection
    end
  end

I did not really understand the necessity to pass the :pool option for each request nor how this should be implemented properly.

I don't think DBConnection is a good fit for multiplexing. It is designed for simplex (SQL) connections for Ecto drivers. It's goals don't really extend beyond that and it forces particular decisions to get the desired Ecto behaviour for SQL adapters.
Before DBConnection we had a poolboy pool of supervising processes (not Supervisors) that started and looked after connection processes and held information about an active transaction. This caused many problems for us because poolboy, the "supervisor", the connection and the calling process held state data of the connection. Unfortunately only the connection process (e.g. multiplexer) knows the state of the connection but it does not let the other processes know of this state because of the top down design. Therefore other processes can get out of sync and errors can be difficult to handle cleanly.
By starting the multiplexer in the connection process and passing its pid as the "socket" this PR returns to the pattern Ecto was going away from. That isn't to say you can't solve these problems, and the main issue for Ecto SQL was transaction handling that rethinkdb does not do.
To solve our issues with transaction status we separated transactions from pooling by passing the underlying socket/state to the calling process (e.g. process calling Rethinkdb.Connection.run). This meant that a calling process hods the full state and if it exits while executing then the socket must be closed because the state is lost. Therefore if a calling process exits while calling Rethinkdb.Connection.run the multiplexer will be closed, closing the cursors/change feeds (sorry I am not familiar with rethinkdb jargon) for other processes.
Because the state is in the calling process for the duration of a call, the connection process will ignore messages because it does not have the state to update. This means that if the connections process is a supervisor for the real connection process (e.g. multiplexer) and it traps exits it can miss an :EXIT message for any processes it start links to if it arrives while checked out. If the supervising process does not trap exits then it will exit if the real connection does. However in this situation the complex backoff/reconnect code provided by DBConnection.
The other main feature of DBConnection connection processes is that a queue is provided so that one calling process can use the socket at the time. When multiplexing this is not required and perhaps counter productive, unless the back pressure is desired for setting up cursors.
DBConnection also provides logging. However when going directly to the multiplexer, i.e. using a cursor, DBConnection is not used so there isn't logging. Meaning logging needs to be (re)implemented if it is desired.
The configuration, e.g. pool choice, is designed with Ecto in mind where configuration is fetched as a keyword from Application.get_env and it makes it easy to pass straight through to all layers: pool, transactions and connection. The current method of pool module selection is not suitable unless limiting the available pools, and unlikely to work well with the DBConnection.Sojourn pool where the initial call will depend on the broker callback module.
However limiting to DBConnection.Connection and DBConnection.Poolboy would work with the __pool__ "hack". But given that and my previous points I am not sure there is enough benefit to using DBConnection over :poolboy just with Connection processes underneath.

Sorry to be negative about the PR and not to suggest an alternative - I am not aware of one designed for your needs. I don't think DBConnection is a good fit here because it makes trade offs that don't fit your use case. I think it would be better in the long run to write your own pool - even if that piggy backs on another library.  Of course if DBConnection is enough, perhaps only in the short term, then go for it.

@fishcakez Thanks for chiming in. I've mentioned this before but getting your feedback is one of my favorite parts of working on this driver. Keep it coming!
Gotta think about this for a bit.

Hello @hamiltop, @fishcakez.
I've been traveling through eastern Europe for the past 2 month. Did not find time to focus on this discussion. Sorry for that.

Sorry to be negative about the PR and not to suggest an alternative - I am not aware of one designed for your needs. I don't think DBConnection is a good fit here because it makes trade offs that don't fit your use case. I think it would be better in the long run to write your own pool - even if that piggy backs on another library. Of course if DBConnection is enough, perhaps only in the short term, then go for it.

First thank you for the great explanation about how and why DBConnection came to life, and why it might not fit with the RethinkDB adapter.
The main reason for me to rewrite RethinkDB.Connection was to better integrate with Ecto. I knew that some specific features such as transactions and prepare/execute would not be required at all by the adapter. On the other side, I thought RethinkDB.Connection would profit a lot from features such as pooling, encode/decode without blocking the connection and exponential backoff to reconnect.
In the end, I think you are right and using DBConnection might bring more trade-offs than benefits.

RethinkDB does not support transactions nor prepare/execute.
RethinkDB.Connection does not depend on configuration (Application.get_env), having to use the __pool__ hack might be a really bad thing in this case (overhead for each query).
Having a pool of multiplexed connections might be the wrong thing for the reasons you listed above. Especially with changes() and crashes.

@hamiltop, sorry for having you putting that much effort/time reviewing code. It helped me to improve my knowledge on OTP, back-pressure, etc. 👍. I did not want to push any decisions in bad/wrong directions. Again, sorry for that.
Parts of the code might still be helpful, RethinkDB 2.3's user authentication for example. Feel free to use it if you want to.

No worries. Getting code review in a setting like this is a fantastic way to share knowledge.
If anything, I'm happy someone else knows the codebase now. Please stick around and help contribute! I'd welcome a PR of just the user auth stuff.

If anything, I'm happy someone else knows the codebase now.

😄

Please stick around and help contribute! I'd welcome a PR of just the user auth stuff.

I'm a little busy right now. Will work on that as soon as possible.


Can OpenLlama model apply lora trained by llama?

Can OpenLlama model apply lora trained by llama?

Hi,
let me try to understand your question:
You are asking if the Alpaca-LoRA adapter weights (e.g. https://huggingface.co/tloen/alpaca-lora-7b) that were trained on top of the non-commercial LlaMA model (e.g https://huggingface.co/decapoda-research/llama-7b-hf in the case of above adapter) are directly applicable to the OpenLlama model?

Hi,
let me try to understand your question:
You are asking if the Alpaca-LoRA adapter weights (e.g. https://huggingface.co/tloen/alpaca-lora-7b) that were trained on top of the non-commercial LlaMA model (e.g https://huggingface.co/decapoda-research/llama-7b-hf in the case of above adapter) are directly applicable to the OpenLLaMA model?

Yes, this is what I concerned.

I understand. Based on my experience and knowledge, I think that what you propose is not possible, as the weights of the original LlaMA model and the OpenLlaMA model are different (even though their architecture and general training procedure is the same). Therefore, the adapter (with its weights) which was trained to "work well" with the original LlaMA model weights no longer works as expected for the OpenLlaMA model.
On the other hand, no one hinders you from training your own LoRA-adapter on the OpenLlaMA model. If you want to do that, I can recommend the following repository as a starting point: https://github.com/tloen/alpaca-lora.
I previously did the same for a German translation of the Alpaca dataset: https://huggingface.co/ludwigstumpp/esel-lora-7b
The whole training was possible to perform in Google Colab Pro (which is 10 euros a month). Or if you have a RTX3090 or 4090 lying aroung, you can easily do it on your local machine as well.
Hope that helps and answers your question. If so, feel free to close this issue.

I understand. Based on my experience and knowledge, I think that what you propose is not possible, as the weights of the original LlaMA model and the OpenLlaMA model are different (even though their architecture and general training procedure is the same). Therefore, the adapter (with its weights) which was trained to "work well" with the original LlaMA model weights no longer works as expected for the OpenLlaMA model.
On the other hand, no one hinders you from training your own LoRA-adapter on the OpenLlaMA model. If you want to do that, I can recommend the following repository as a starting point: https://github.com/tloen/alpaca-lora.
I previously did the same for a German translation of the Alpaca dataset: https://huggingface.co/ludwigstumpp/esel-lora-7b The whole training was possible to perform in Google Colab Pro (which is 10 euros a month). Or if you have a RTX3090 or 4090 lying aroung, you can easily do it on your local machine as well.
Hope that helps and answers your question. If so, feel free to close this issue.

Okay, I see, I have ever apply StableDiffusion Lora which trained from one checkpoint to another checkpoint, and that worked, therefore I am thinking about whether llama loras have the same usage.

Jumping on this @LudwigStumpp, did you train few epochs on pure german data before fine-tuning?

No, I did not do any intermediate pre-training on german language. I directly began with the german instruction-tuning. Maybe that might be a good idea to do. However I found out that the original Llama model is actually already able to output german responses.


PI-8607 quickfix for "Can't read prop characteristics of undefined"

Coverage decreased (-0.01%) to 33.569% when pulling 08e10d87e33ca774db8d8ec66750f68eb262b1ee on PI-8607-characteristics-of-undefined into 9559d7773513ef3ffde46cd329981ec79f2fa9a9 on master.


Support for custom keybaord.

First, thx for the great tool. But, it would be better to support for debugging app extension: keyboard.

It would be awesome to create a lot of keyboard shortcuts and activate them via bluetooth keyboard

Keyboards run in other processes and are displayed inside other apps. You may be able to display the FLEX tool over your own keyboard, but I don't know why that wouldn't work right now


Improve error reporting when an Ogg audio file fails to import

I tried to load hello.ogg into Godot, but it's actually an MP3 file. 😄 So, this issue now tracks making it a little more obvious in the UI what's going on. Original issue text below:

Original issue

Godot version:
Reproduces in 3.2.3 and 3.2.4-rc3
OS/device including version:
Windows 10 x64
Issue description:
Adding this ogg file (attached in repro steps) to a project gives me some error logs in the Godot console:
ERROR: set_data: Condition "ogg_stream == __null" is true.
   At: modules/stb_vorbis/audio_stream_ogg_vorbis.cpp:202
ERROR: import: Condition "!ogg_stream->get_data().size()" is true. Returned: ERR_FILE_CORRUPT
   At: modules/stb_vorbis/resource_importer_ogg_vorbis.cpp:102
ERROR: _reimport_file: Error importing 'res://hello.ogg'.
   At: editor/editor_file_system.cpp:1795

And the UI shows it failed to import:

The file plays fine in various players and opens in Audacity.
Steps to reproduce:
Create a new project and add hello.ogg: hello.zip
Minimal reproduction project:
ogg_project.zip

Is there a minimal stb_vorbis loader we can try out to see if this is an issue with stb_vorbis itself?

That's because a.ogg is actually a MP3 file :slightly_smiling_face:
$ file a.ogg
a.ogg: MPEG ADTS, layer III, v2,  32 kbps, 24 kHz, Monaural

Oh... oops. 😄 Thanks. I don't know an easy way to tell on Windows (but I don't work with audio files much).

Oh... oops. smile Thanks. I don't know an easy way to tell on Windows (but I don't work with audio files much).

You can install FFmpeg and use the ffprobe <path to file> command, or install a port of file for Windows and use file <path to file>.
Both can be installed using Scoop:
scoop install ffmpeg file

I've noticed that image_loader.cpp checks the header of it's resource when loading, to ensure the format is valid; maybe this could be implemented for all binary resources?
https://github.com/godotengine/godot/blob/8fbe644b6e6548dc2c9f9d675bc17f13b74e747b/core/io/image_loader.cpp#L137-L144

Fixed by #56903.


New version: OSGeo.QGIS_LTR version 3.34.8 (3.34.8-1)

Created by 🥟 Dumplings.
Microsoft Reviewers: Open in CodeFlow

/azp run

/azp run

This package installs and launches normally on a Windows 10 VM.


Fix libuv symlink instructions

See https://github.com/aspnet/KestrelHttpServer/issues/78#issuecomment-163366503

Just saw a PR was already open for this: https://github.com/aspnet/Docs/pull/777


ValueError: unichr() arg not in range(0x10000)

Just trying out this tool, after installing with pip and executing the below command in a git repo, I get the following error.
detect-secrets scan
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/detect-secrets", line 10, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/main.py", line 47, in main
    baseline_dict = _perform_scan(args, plugins)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/main.py", line 146, in _perform_scan
    scan_all_files=args.all_files,
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/core/baseline.py", line 58, in initialize
    output.scan_file(file)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/core/secrets_collection.py", line 208, in scan_file
    self._extract_secrets_from_file(f, filename_key)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/core/secrets_collection.py", line 308, in _extract_secrets_from_file
    results.update(plugin.analyze(f, filename))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/plugins/high_entropy_strings.py", line 71, in analyze
    output = analyze_function(file, filename)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/plugins/high_entropy_strings.py", line 213, in _analyze_yaml_file
    data = parser.json()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/plugins/common/yaml_file_parser.py", line 55, in json
    return self.loader.get_single_data()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/constructor.py", line 43, in get_single_data
    node = self.get_single_node()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/plugins/common/yaml_file_parser.py", line 60, in _compose_node_shim
    node = yaml.composer.Composer.compose_node(self.loader, parent, index)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/plugins/common/yaml_file_parser.py", line 60, in _compose_node_shim
    node = yaml.composer.Composer.compose_node(self.loader, parent, index)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/plugins/common/yaml_file_parser.py", line 60, in _compose_node_shim
    node = yaml.composer.Composer.compose_node(self.loader, parent, index)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/plugins/common/yaml_file_parser.py", line 60, in _compose_node_shim
    node = yaml.composer.Composer.compose_node(self.loader, parent, index)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/plugins/common/yaml_file_parser.py", line 60, in _compose_node_shim
    node = yaml.composer.Composer.compose_node(self.loader, parent, index)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/detect_secrets/plugins/common/yaml_file_parser.py", line 60, in _compose_node_shim
    node = yaml.composer.Composer.compose_node(self.loader, parent, index)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/composer.py", line 64, in compose_node
    if self.check_event(AliasEvent):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/parser.py", line 449, in parse_block_mapping_value
    if not self.check_token(KeyToken, ValueToken, BlockEndToken):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/scanner.py", line 251, in fetch_more_tokens
    return self.fetch_double()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/scanner.py", line 655, in fetch_double
    self.fetch_flow_scalar(style='"')
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/scanner.py", line 666, in fetch_flow_scalar
    self.tokens.append(self.scan_flow_scalar(style))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/scanner.py", line 1155, in scan_flow_scalar
    chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yaml/scanner.py", line 1223, in scan_flow_scalar_non_spaces
    chunks.append(unichr(code))
ValueError: unichr() arg not in range(0x10000) (narrow Python build)

Wow. From the stack trace, looks like the issue is with your YAML file. From a quick Google search, it also looks like the issue can be addressed by moving to Python3.
My hypothesis is that it's nothing to do with detect-secrets itself. To verify this, you can try:
# Attempt to find the YAML file containing unicode (you might need to modify the grep query)
$ find . -name '*.yaml' | xargs grep 'u"'

# Try to open that file manually.
$ python -i
>>> import yaml
>>> yaml.load(<path-to-file>)

Hi @domanchi, which yaml file are you referring to?

Is it worth having a fallback to simple text based loading of the file if the yaml parsing doesn't work?

@HenryHoggard, if you would like, you can certainly contribute a PR to the v1 branch (https://github.com/Yelp/detect-secrets/blob/pre-v1-launch/detect_secrets/transformers/yaml.py#L29). However, given that we've deprecated Python2.7 usage (and soon to be deprecating Python3.6), I'm going to close this as "Won't Fix".
Secrets in un-parseable files fall in the realm of philosophical questions. In order to improve scan speeds and reduce false positives, I'm opting not to scan things that will not be used as a secret source in regular usage. This being said, I will still accept a PR that modifies this (as it shouldn't change intended behavior much).


Create lexicographical numbers using C++

Q. Given an integer n, return all the numbers in the range [1, n] sorted in lexicographical order. You must write an algorithm that
runs in O(n) time and uses O(1) extra space.
Please assign me this issue.

plz assign this task to me...

i just completed c++ please assign this to me

Read the guidelines carefully. make sure you follow and star the repository!


#107 fixed Angle Type Classifier

Issue Id you have worked upon -
#107
Briefly explain your program logic -
Using if else conditions to classify angles, giving input it will result in classifying the type of angle
Screenshots(Attach 2 screenshots of your own input and output) -

By raising this PR I affirm that -

[x] My code follows the guidelines of this project.

[x] I have performed a self-review of my own code.

[x] I have commented my code.

[x] My code gives the correct output.

[x] I affirm that I strictly follow contributing guidelines and code of conduct.

Congratulations 🎉 @Sam-bhav-20 on your contribution.
Thanks for adding value to this repository. 😊

Let's celebrate this fest 😃 by providing more developers 👨💻👩💻 an opportunity to contribute. Help us make this repository reach far and more by sharing this to your friends and colleagues.
Your efforts can make difference.


Feat: update wagmi to latest version

A PR to resolve this comment should include an update to TypeScript as well.


Caching Performance Is Slow

@howya wrote:

Hi Mike,
I've put together a very simple example at:
https://github.com/howya/laravel_builder_cache
Just clone it, composer install, then setup the phpunit.xml environment variables to point at your MySQL server and Redis server.
Once setup you can run 'composer test' to run a simple performance test. The performance test runs a 1000 iteration loop of query calls (I chose these queries as they are similar to what I require in a project I'm working on). The loop is replicated 3 times:

Once for queries against Non-Cached 'standard' models
Once for queries against Builder-Cached models - this is an experimental cache that I'm playing with
Once for queries against Model-Cached models - this is your package

The test is trivial and does not reflect real world usage as it does not bust the cache and the query domain space is very small i.e. MySql is probably hitting its own cache 100% of the time.
The results I get are:
"Non-Cached time taken: 25.299576044083"
"Builder-Cached time taken: 24.184181928635"
"Model-Cached time taken: 35.246420145035"
I would have assumed that our caching strategies would have been the same or slightly slower than 'Non-Cached' in this test as MySql is probably hitting its own cache 100% of the time. I'm not sure why yours is approx 50% slower. Have I made an error when implementing your caching package?

@howya Off the top of my head, this package is more suited to cache complex queries that take a long time to run on their own. That's where the performance improvement lies.
Thanks for putting together a repo, I will play with it and see what's happening. I know that properly configuring redis or memcached can have a large effect on performance.

Hi Mike,
Your explanation re use-case makes sense. The strategy I'm working on is designed for slowly changing data such as application meta / config data etc. As such it is designed to make as few cache calls per query as possible (it stores the whole SQL result in a single key). I think this is the main difference in performance as I notice your package makes many more cache calls than my strategy, as such it will become more susceptible to latency etc.
I made a few updates to the test repo (to compress 'builder-cached' cache entires - big positive impact on performance) and also adjusting the total intersection records in the test data set. This has the effect of changing the size of the record set returned and makes it a more real world scenario:
(redis-cli flushall called before each test)
With 600 intersection records:
"Non-Cached time taken: 79.835070848465"
"Builder-Cached time taken: 69.807591199875"
"Model-Cached time taken:<PHONE_NUMBER>2059"
I then tested with 300 intersection records:
"Non-Cached time taken: 54.8621301651"
"Builder-Cached time taken: 44.611806154251"
"Model-Cached time taken: 82.691457986832"
I then tested with 60 intersection records:
"Non-Cached time taken: 30.076621055603"
"Builder-Cached time taken: 26.164316177368"
"Model-Cached time taken: 39.56648182869"
I then tested with 9 intersection records:
"Non-Cached time taken: 24.722324848175"
"Builder-Cached time taken: 22.5115878582"
"Model-Cached time taken: 30.38514995575"
To Note: I'm using a simple Redis server within a Docker container on my Mac, average Redis latency is 0.42 - The test results above would seem to indicate that less cache calls with each call returning a larger data set is more performant than more cache calls with each call returning a very small data set. I'm guessing that this could change considerably if the Redis server were optimised for latency rather than throughput.
Perhaps an adaptive approach to deciding if you should store many small cache items or fewer large cache items would give you the best of both worlds?

You've got me curious: would you mind running these tests against memcached and post the results?

Certainly, I'll take a look tomorrow. Would be great if you could have a quick look at the repo as I'm not 100% sure I've implemented your package correctly.

I probably wont have time today, will most likely have to wait until the weekend. I'll let you know if I do. :) Thanks!

Hi Mike,
I've re-run the tests against Memcached and Redis - I repeated the Redis test runs as I had to use a slightly different docker environment for Memcached, so wanted all things to be equal between Redis and Memcached results. You'll see that the re-run tests for Redis are better than yesterdays results, I think this is down to PHP to Redis having a lower latency as they now exist in their own containers, rather than PHP executing directly on my laptop (as reflected in yesterday's results).
In my latest environment I have a separate container for MySQL, PHP, Redis and Memchached servers. I run the PHP tests from within the PHP container, rather than directly  I have not attempted to optimise Redis or Memcached. After each run the Memcache / Redis cache is flushed.
Results attached.
Workbook1.xlsx
Regards,
Rob

If I understand you correctly then the query count will be the same for each test. Each test has 1000 iterations and each iteration has the following 8 queries:
        $class::with('integrated')->findOrFail(1)->integrated;         $class::findOrFail(2);         $class::with('integrated')->get();         $class::whereHas('integrated', function ($query) {             $query->where('client_id', '=', '2');         })->get();         $class::with('integrated')->findOrFail(2)->integrated;         $class::findOrFail(3);         $class::with('integrated')->get();         $class::whereHas('integrated', function ($query) {             $query->where('client_id', '=', '1');         })->get();
That makes a total of 8000 Model queries per test (I used the above queries as they are similar to the queries I'm using in a current project).
So what changes between each test? It's the number of records in the intersection, which correlates to the size of the result set i.e. 600 interaction records could result in a result set of 200 rows (the parent / child id's in the intersection will be equally split between 1, 2 or 3 and the parents / children are id'd as 1,2 or 3 etc).
The test is designed to assess performance of caching result sets and I wanted to understand impact of size of result set on performance - particularly the impact of storing the result set against many cache entries (your method) or storing the result set in one compressed cache entry (my method). Potentially, with large result sets, there may be no point in caching, it may simply be faster to go back to the DB.....
Have I understood your question correctly?

Just to add a quick update. I've done some analysis on Redis to understand number of keys used and volume of key requests. I'd made some assumptions about your implementation which are clearly wrong - I thought your volume of cache requests would grow with the result set size, but they are relative to the number of queries.
For 1000 x 8 Model queries your package uses 19 keys and makes approximately 44k cache requests.
For the same my implementation uses 15 keys and makes approximately 28k cache requests.
Is there a bug creating surplus cache requests because it looks like that is where you're losing performance?
Hope this helps.

Regarding queries I am referring to the number of times the database is hit. There should only be one (or a few) initial queries the first time around, and then for subsequent requests all should come from the cache.
The cache key request count is good info, that will help me when I look at it. I don't have an answer at the top of my head.

here is my time results when running against 10 iterations:
"Non-Cached time taken: 2.6008288860321"
"Builder-Cached time taken: 2.8003520965576"
"Model-Cached time taken: 1.0957701206207"

Hi Mike, did you clear your Redis cache before each test? As I mentioned, I've just set up Redis / Memcached on a local docker container without any attempt at optimisation. I'll take another look this week.

I ran your code exactly as you had it, all i changed was the configuration.

Hi Mike,
I've updated the repo as follows:

It now clears the cache before test (I was doing this manually)
I've set it to a SQLite DB

When I run the test it now shows the following results for 600 intersection records:
"Non-Cached time taken: 14.588853120804"
"Builder-Cached time taken: 23.193886041641"
"Model-Cached time taken: 33.07765007019"
I'd expect SQLite to be faster than caching.
The only difference that there could be is with the Redis environment. Can you pull this repo and only change the following in phpunit.xml to ensure that you're not introducing other issues?
   <env name="REDIS_HOST" value="redis"/>
    <env name="REDIS_PASSWORD" value="yourpassword"/>
    <env name="REDIS_PORT" value="6379"/>
    <env name="MODEL_CACHE_STORE" value="redis"/>

Regards,
Rob

Here are the results:
"redis"
array:5 [
  "driver" => "memcached"
  "persistent_id" => null
  "sasl" => array:2 [
    0 => null
    1 => null
  ]
  "options" => []
  "servers" => array:1 [
    0 => array:3 [
      "host" => "<IP_ADDRESS>"
      "port" => 11211
      "weight" => 100
    ]
  ]
]
"Non-Cached time taken: 88.467418909073"
"Builder-Cached time taken: 95.473206043243"
"Model-Cached time taken: 39.337776899338"

And here is my config file:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="vendor/autoload.php"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false">
    <testsuites>
        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>

        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./app</directory>
        </whitelist>
    </filter>
    <php>
        <env name="APP_KEY" value="base64:nuiNs2u8nhcU/c00PGLqS7qKUl7b1GuydISIxaALZrU="/>
        <env name="APP_ENV" value="testing"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="QUEUE_DRIVER" value="sync"/>
        <env name="MAIL_DRIVER" value="array"/>

        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>

        <env name="REDIS_HOST" value="<IP_ADDRESS>"/>
        <env name="REDIS_PASSWORD" value="NULL"/>
        <env name="REDIS_PORT" value="6379"/>
        <env name="MODEL_CACHE_STORE" value="redis"/>
    </php>
</phpunit>

Tried it with your phpunit.xml with just REDIS_HOST and REDIS_PASSWORD updated and get the following:
"Non-Cached time taken: 16.817641973495"
"Builder-Cached time taken: 26.729877948761"
"Model-Cached time taken: 33.037648200989"
I've no idea why we get such a discrepancy, I can only imagine it's my very basic Redis install - though why this causes your code to perform poorly (and not mine) I have no idea.
I'll see if I can replicate this in work with an optimised Redis environment.

Try using a Homestead environment to test. I bet containers are hurting performance if they are optimized. I use Homestead because it mirrors my Laravel Forge servers closely.

@howya I'm going to close this for now, as this is really an environmental issue, and not necessarily a problem with this package. Please do update with your findings if you are able to. Thanks!


IMPROVEMENT: ConeSearch

With daiquiri there are 4 ways of running a cone search:

Via IVOA SOAP interface: ConeSearch
Via Web Interface (in app query, JS)
Via TAP with PostgreSQL
Via TAP with ADQL

All of these ways lead to various performances and/or results.
IVOA SOAP
https://github.com/django-daiquiri/daiquiri/blob/master/daiquiri/conesearch/adapter.py#L17
The data access is done directly via the DatabaseAdapter, with a query defined in the conesearch adapter.
Therefore the performances and results will depend on the pre-defined query.
Web Interface
https://github.com/django-daiquiri/daiquiri/blob/master/daiquiri/query/static/query/js/forms/cone.js
The data access is done via the REST API of the query-app. The query is defined within the JS files, and may differ from the
IVOA Soap query. Again performances and results will depend on the query.
Note: per default only ra, dec, and search radius are available parameter, the official verb (the list of columns) and resource (the table to query) values are not available, but can be added within the adapter.
TAP PostgreSQL
The TAP service also allow the user to submit queries carrying out a cone search. In PostgreSQL they look like:
SELECT id, ra, dec, <OTHER-COL>,
       DEGREES( SPOINT( RADIANS(ra), RADIANS(dec)) <-> SPOINT(RADIANS(<RA>), RADIANS(<DEC>))) as adist
  FROM <RESOURCE>
 WHERE SPOINT( RADIANS(ra), RADIANS(dec)) @ SCIRCLE(SPOINT( RADIANS(<RA>), RADIANS(<DEC>)), RADIANS(<SRADIUS>))

This type of cone search are quite slow, and will always require LONG Queue. For this reason we usually provide an additional column for the conesearchable tables: pos. This column is of type SPOINT which is not a native PostgreSQL type but is declared by the Postgres module PGIST. When the pos column is indexed, one can build very efficient queries like:
SELECT id, ra, dec, <OTHER-COL>,
       DEGREES( pos <-> SPOINT(RADIANS(<RA>), RADIANS(<DEC>))) as adist
  FROM <RESOURCE>
 WHERE pos @ SCIRCLE(SPOINT( RADIANS(<RA>), RADIANS(<DEC>)), RADIANS(<SRADIUS>))

From experience, this queries will run about 20 time faster than the precedent.
TAP ADQL
 SELECT source_id, ra, dec, <OTHER-COL>,
        DISTANCE( POINT('ICRS', ra, dec), POINT('ICRS', <RA>, <DEC>) AS dist
   FROM <RESOURCE>
  WHERE 1 = CONTAINS( POINT('ICRS', ra, dec), CIRCLE('ICRS', <RA>, <DEC>, <SRADIUS>))

This will be translated into PostgreSQL as:
SELECT id, ra, dec, <OTHER-COL>,
       DEGREES( SPOINT( RADIANS(ra), RADIANS(dec)) <-> SPOINT(RADIANS(<RA>), RADIANS(<DEC>))) as adist
  FROM <RESOURCE>
 WHERE SPOINT( RADIANS(ra), RADIANS(dec)) @ SCIRCLE(SPOINT( RADIANS(<RA>), RADIANS(<DEC>)), RADIANS(<SRADIUS>))

Which is an issue since it does not make use of the indexed pos columns, and lead to much longer query time.
Issues

There are two access points for the IVOA Soap and Web ConeSearch, leading to different results.
The Performance of the TAP ConeSearch depends on the language used, and the use of the pos column.

Possible solutions

Unify the access point to science data: see #213
In case a pos column is available improve translation from ADQL to Postgres and replace SPOINT( RADIANS(ra), RADIANS(dec)) by pos.

The translation of a query is done here:
https://github.com/django-daiquiri/daiquiri/blob/master/daiquiri/query/process.py#L123
at this place:
https://github.com/django-daiquiri/daiquiri/blob/master/daiquiri/query/models.py#L150
The basic idea to catch the possibility of adapting the query to the specific DB, like in the case of a pos column would be to add a method called: optimize_for_db that takes translated_query as argument and uses settings to optimize the query.
In the case of cone search we could imagine a declaration of optimizable tables (the ones with a pos column) and a mapping between the name of the table and its pos attributes (name of the ra and dec columns).
CONESEARCH_TABLES = [
    {"table_name": "gaiadr3"."gaia_source",
     "ra_col": "ra",
     "dec_col": "dec",
    },
    ...
]

This could be then used alike:
            # translate the query from adql
            translated_query = translate_query(self.query_language, self.query)

            # log the translated query to the debug log
            logger.debug('translated_query = "%s"', translated_query)

            # optimize the query
            optimized_query = optimize_query(self.query)

            processor = process_query(optimized_query)

With
            def optimize_query(query):
                for table in query.tables:
                    if table in [table['table_name'] for table in CONESEARCH_TABLES]:
                        ra_col = table['ra_col']
                        dec_col = table['dec_col']
                        if "SPOINT(RADIANS(" + ra_col + "), RADIANS(" + dec_col + "))" in query.query_string:
                             replace(query, "SPOINT(RADIANS(" + ra_col + "), RADIANS(" + dec_col + "))", "pos")

Obviously one need to be careful in case of table renaming: FROM table as t1 and other details of the implementation, this suggestion is surely not the best one.


"query" returns an error msg in 4 peers with security enabled (level=384), consensus=obcbpft

Set up a 4 peers on LoZ platform with security enabled (level=384), consensus=obcbpft,
but the "query" returns an error msg like:
  Error: Error querying chaincode: rpc error: code = 2 desc = "Error:Failed to execute transaction or query(Timeout expired while executing transaction)"

Here is the replicate steps:

Using openchain.yaml
openchain.yaml.zip and default *.yml file  to start 4 peers;

run obcpeer_cli_1
docker exec -it obcpeer_cli_1 bash
OPENCHAIN_PEER_ADDRESS=vp0:30303 obc-peer login jim

"Deploy" a chaincode
OPENCHAIN_PEER_ADDRESS=vp0:30303 obc-peer chaincode deploy -u jim -p github.com/openblockchain/obc-peer/openchain/example/chaincode/chaincode_example02 -c '{"Function":"init", "Args": ["a","1000", "b", "2000"]}'

Send a quey
OPENCHAIN_PEER_ADDRESS=vp0:30303 obc-peer chaincode query -u jim -l golang -n NAME -c '{"Function": "query", "Args": ["a"]}'

The NAME is a string returned by deploy command
Then it gets an error msg shown above
Here is the logs of vp1-2 and chaincode
vp_log.zip
log of vp0:
 16:38:21.854 [chaincode] func1 -> ERRO 027 [e125d754]Got error (Decryption failed.) while decrypting. Sending ERROR
 16:38:21.855 [chaincode] processStream -> ERRO 028 [e125d754]Error handling message, ending stream: [e125d754-05af-4034-b3e7-8a18a11a29a7]Chaincode handler validator FSM cannot handle message (ERROR) with payload size (134) while in state: ready

More Info:
Tested a few times, the error does not occur all the time. When it happens, The status of dev-vp0 is changed to "Exited"

I got the similar error in my env. Have to rebuild the whole environment.

@genggjh : By "whole environment" do you mean to build two openchain-peer and obcca images?
Thanks,

recreate obc-peer and obcca container not images.

More Info: when starting with 8 peers, every time gets this error.

Following are detail messages I reproduce it in my test env recently:
02:23:04.206 [chaincode] beforeRegisterEvent -> DEBU 0f8 Got REGISTER for chaincodeID = name:"bb540edfc1ee2ac0f5e2ec6000677f4cd1c6728046d5e32dede7fea11a42f86a6943b76a8f9154f4792032551ed320871ff7b7076047e4184292e01e3421889c" , sending back REGISTERED
02:23:04.206 [chaincode] notifyDuringStartup -> DEBU 0f9 Notifying during startup
02:23:04.206 [chaincode] initOrReady -> DEBU 0fa sending INIT
02:23:04.230 [chaincode] processStream -> DEBU 0fb [bb540edf]Move state message INIT
02:23:04.230 [chaincode] HandleMessage -> DEBU 0fc [bb540edf]Handling ChaincodeMessage of type: INIT in state established
02:23:04.231 [chaincode] beforeInitState -> DEBU 0fd Before state established.. notifying waiter that we are up
02:23:04.231 [chaincode] notifyDuringStartup -> DEBU 0fe Notifying during startup
02:23:04.231 [chaincode] enterInitState -> DEBU 0ff [bb540edf]Entered state init
02:23:04.233 [chaincode] processStream -> DEBU 100 [bb540edf]Received message PUT_STATE from shim
02:23:04.233 [chaincode] HandleMessage -> DEBU 101 [bb540edf]Handling ChaincodeMessage of type: PUT_STATE in state init
02:23:04.233 [chaincode] afterPutState -> DEBU 102 Received PUT_STATE in state busyinit, invoking put state to ledger
02:23:04.233 [chaincode] func1 -> DEBU 103 [bb540edf]state is busyinit
02:23:04.233 [chaincode] func1 -> DEBU 104 [bb540edf]Failed to handle PUT_STATE. Sending ERROR
02:23:04.233 [chaincode] 1 -> DEBU 105 [bb540edf]enterBusyState trigger event ERROR
02:23:04.233 [chaincode] processStream -> DEBU 106 [bb540edf]Move state message ERROR
02:23:04.233 [chaincode] HandleMessage -> DEBU 107 [bb540edf]Handling ChaincodeMessage of type: ERROR in state busyinit
02:23:04.233 [chaincode] enterInitState -> DEBU 108 [bb540edf]Entered state init
02:23:04.233 [chaincode] processStream -> DEBU 109 [bb540edf]sending state message ERROR
02:23:04.234 [chaincode] processStream -> DEBU 10a [bb540edf]Received message ERROR from shim
02:23:04.234 [chaincode] processStream -> DEBU 10b Got error: [bb540edfc1ee2ac0f5e2ec6000677f4cd1c6728046d5e32dede7fea11a42f86a6943b76a8f9154f4792032551ed320871ff7b7076047e4184292e01e3421889c]Chaincode handler FSM cannot handle message (ERROR) with payload size (75) while in state: established
02:23:04.234 [chaincode] HandleMessage -> DEBU 10c [bb540edf]Handling ChaincodeMessage of type: ERROR in state init

we should reverify this one and close if still relevant. @JonathanLevi maybe a test(s) could be added? if not, we should close.


Build scans are not captured

In this run it is possible to see the scan in the logs

But in the summary it is not appearing:

https://github.com/JavierSegoviaCordoba/semver-gradle-plugin/actions/runs/4394281726#summary-11932819131

Yes, it is happening on all projects on different workflows. I am using reusable workflows, not sure if that can be the problem.
I don't know what do you mean about reproducing it locally, I haven't developed any GitHub Action before 🤔

The way the action captures the build scan is via some scripts placed in the Gradle User Home init.d directory. If you put these in your local Gradle User Home you might be able to debug why they aren't working.
So to reproduce:

Copy the init scripts linked above into ~/.gradle/init.d.
Export the appropriate env vars: RUNNER_TEMP is a directory and GITHUB_ACTION can be any string.
Run the build
Look for a .build-results directory generated in the RUNNER_TEMP directory.
If you don't see it, add some println statements to see where the initialization scripts are failing.

There is a json file:
GRADLE_ACTION-1680031868132.json
{
  "rootProjectName": "gradle-extensions-project",
  "rootProjectDir": "D:\\Repos\\gradle\\gradle-extensions",
  "requestedTasks": "assemble",
  "gradleVersion": "8.0.2",
  "gradleHomeDir": "C:\\Users\\javøie\\.gradle\\wrapper\\dists\\gradle-8.0.2-bin\\25jlreiuz6u3xu2phlpa2vv4m\\gradle-8.0.2",
  "buildFailed": false,
  "buildScanUri": "https://gradle.com/s/bai43tyy44txq",
  "buildScanFailed": false
}

Thanks. I think the fact that this file generates for you locally (with a buildScanUri) indicates something amiss in the action post-processing. I'm not actively working on this project at the moment, but will attempt to reproduce/fix this problem before the next major release.

@JavierSegoviaCordoba I finally got around to investigating this. It turns out that the issue was due to the way we detect the com.gradle.enterprise plugin being applied, and the fact that you are applying the plugin inside a settingsEvaluated block.
While I think it's a bit odd to apply a settings plugin during settingsEvaluated, I've found a way to modify our init scripts so they handle this case.
Can you please try running your project with gradle/gradle-build-action@dd/issue626 and check if build scan links are correctly captured?

How should I apply it?

Apologies, I missed the hyphen from the version: you can literally reference gradle/gradle-build-action@dd/issue-626 in your YAML file.
So replace gradle/gradle-build-action@v2 with gradle/gradle-build-action@dd/issue-626.
This will cause your workflow to run with the action code in the dd/issue-626 branch.

Sorry I was referring to gradle enterprise and how to apply it on settings plugins

It works, feels free to close it now or when the change is published :)

It works, feels free to close it now or when the change is published :)

Will do. Can you confirm that by "it works" you mean that you tried the dd/issue-626 branch and you are now getting build scan links published?
Did you also try moving the plugin application outside of the settingsEvaluated block? Just curious.

I moved it but I haven't tested it yet, I will share it here when the test is done!

Applying the plugin as you have said works too, thank you 🙏


feat: Add GitHub icon in the Footer

What feature?
I want to add a GitHub link in the footer section to make it more accessible.
Add screenshots

Record

[X] I agree to follow this project's Code of Conduct
[X] I'm a GSSoC'23 contributor
[X] I want to work on this issue

we are on new footer adding feature so currently we don't need


Extract Apollo cache for SSR

Hello,
I'm trying to use Apollo Client with SSR and React.
My idea was to create a InMemoryCache and extract data from the store. It seams that viteSSR does not wait the resolution of a query. If I add a setTimeout to the hook of viteSSR, I cant print the good content of the store.
According the Apollo Documentation, I have to use renderToStringWithData. But I have no idea how I can manage with vite-ssr plugin. Is it possible?
Thank you very much.
./server/index.js
// This is the server renderer we just built
const main = import('../dist/server/main.js');

server.get('*', async (req, res) => {
  const url = `${req.protocol}://${req.get('host')}${req.originalUrl}`;
  const renderPage = (await main).default.default;

  const apolloCache = new InMemoryCache();

  const { html } = await renderPage(url, {
    manifest,
    apolloCache,
    preload: true,
  });

  res.setHeader('Cache-Control', 'max-age=0');
  res.end(html);
});

./src/App.jsx
const App = ({
  isClient,
  apolloCache = new InMemoryCache(),
}) => {
  const client = new ApolloClient({
    link: createHttpLink({
      uri: 'http://localhost:8080/graph',
      credentials: 'same-origin',
    }),
    ssrMode: !isClient,
    cache: apolloCache,
    credentials: 'same-origin',
  });
...

./src/main.jsx
export default viteSSR(App, { routes }, ({
  initialState,
  apolloCache,
}) => {
  if (import.meta.env.SSR) {
    setTimeout(() => {
      console.log(apolloCache.extract()) // not empty
    }, 1000)
    initialState.apolloCache = apolloCache.extract();
  }
  // Custom initialization hook
})

Hi @tcastelly ! Tell me if something like this works in your project:
// This is the server renderer we just built
const main = import('../dist/server/main.js');

server.get('*', async (req, res) => {
  const url = `${req.protocol}://${req.get('host')}${req.originalUrl}`;
  const renderPage = (await main).default.default;

  const apolloCache = new InMemoryCache();

  const { html } = await renderPage(url, {
    manifest,
-   apolloCache,
+   initialState: { apolloCache },
    preload: true,
  });

  res.setHeader('Cache-Control', 'max-age=0');
  res.end(html);
});

const App = ({
  isClient,
- apolloCache = new InMemoryCache(),
+ initialState,
}) => {
  const client = new ApolloClient({
    link: createHttpLink({
      uri: 'http://localhost:8080/graph',
      credentials: 'same-origin',
    }),
    ssrMode: !isClient,
-   cache: apolloCache,
+   cache: initialState.apolloCache,
    credentials: 'same-origin',
  });

export default viteSSR(App, {
  routes,
  transformState(state) {
    if (import.meta.env.SSR) {
      // Serialize
      state.apolloCache = state.apolloCache.extract()
      return JSON.stringify(JSON.stringify(state))
    } else {
      // Deserialize
      state = JSON.parse(state)
      state.apolloCache = new InMemoryCache().restore(JSON.parse(state.apolloCache))
      return state
    }
  }
}, (ctx) => {
  // Custom initialization hook
})

If this works, I will add a second parameter defaultTransformer to the transformState hook so you don't need to care about stringify/parse and escaping dangerous characters for XSS.

Thank you for your help.
In the main.jsx, the state is always null.
I create a project it can be easier to test:
https://github.com/shenron/vite-ssr-starter

@tcastelly Ah right, I forgot about the development server. This fixes it and is a bit simpler:
export default viteSSR(App, {
  routes,
  transformState(state) {
    if (import.meta.env.SSR) {
      // Serialize
      state.apolloCache = state.apolloCache.extract();
      return JSON.stringify(JSON.stringify(state));
    }

    // Deserialize
    return JSON.parse(state);
  },
}, ({ initialState }) => {
  // Custom initialization hook
  if (import.meta.env.SSR) {
    initialState.apolloCache = new InMemoryCache();
  } else {
    initialState.apolloCache = new InMemoryCache().restore(initialState.apolloCache);
  }
});

You can stop passing initialState: { apolloCache } from your production server since it's already done in the main hook.

@tcastelly I've added defaultTransformer in 0.8.1. You can simplify the transformState like this (keep the code in the main hook as in the previous comment):
transformState(state, defaultTransformer) {
  if (import.meta.env.SSR) {
    state.apolloCache = state.apolloCache.extract();
  }

  return defaultTransformer(state);
}

@tcastelly I've been playing with Apollo internals for a while and I think I got it working. The simplest solution is probably using getDataFromTree instead of React's renderToString until Apollo supports Suspense. I'll try to figure out a way to provide it in vite-ssr API soon 👍

Thank you for your help.
I have issue with getDataFromTree, during the "hydration" this article helped me:
https://lihautan.com/hydrating-text-content/
So instead I use renderToStringWithData.

@tcastelly Can you check v0.9.0? It should use renderToStringWithData automatically if it detects you have @apollo/client and @vitejs/plugin-react-refresh installed.
I tried it in your repo and it does await for the loading variable to become false so it doesn't render Loading... anymore. However, the GraphQL query returns undefined for some reason but that might be related to the API 🤔

It works better thank you :)
But I have a strange behavior.
In this demo project, each page resolve props once and the home page resolve a QraphQL query.
In the ./client/api.jsx I print the state. In ssr mode I see only the apolloCache. Else I see the result of the default query.
// from ssr: { apolloCache: InMemoryCache2 }
// else {body: {…}}
console.log(route.meta.state);
return <Page {...route.meta.state} />;

To reproduce:

npm run dev

Go the the About page from Home. And try to load directly this About page.
Thank you very much for your help.

@tcastelly I think that's expected 🤔 . Only the first route gets the initialState in its route.meta.state after rehydration. Further navigation (SPA mode) to other routes don't get anything in their respective route.meta.state.
I'm not sure what you are trying to accomplish. If you need the whole initialState in every page, you can pass it from your App.jsx as props I guess.
Also, are you going to mix Apollo queries and page-props?

I've added a simple example for manual testing based on your repo here: https://github.com/frandiox/vite-ssr/tree/master/examples/react-apollo

I'm agree, only the first route gets the initialState.
I created this project from your react example, add I added an Apollo Query to try. So I mixed Apollo queries and page props. Maybe not a good idea because there is no more props in pages during the first launch.
Anyway, vite-ssr plugin with Apollo works now!
Thank you very much for your time.

@tcastelly Thanks for all the reproduction and information you provided here, glad it's now working!


Is there a way to match the tag color to the Log-type color?

For example,
The following log is an Info log with the tag DEBUG:
 97           DEBUG  I  40f83efc 0000100b 20786469 63616669 63612065  ....idx iface ac

The DEBUG tag was coloured blue here. Is there a way I can match all tag colours to their respective log-type colours?
Thanks

You can assign custom colors to tags in a profile using  tags = { "tag": COLOR } (see the README.md), but it has the side effect of filtering out all other tags in your output. Assigning colors to tags without filters would be a good feature request..


Use Open Government licence?

It's not really designed for code but should we be using the https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/?
Currently this is published with the MIT licence which is very similar so I don't think there's any change in permissions between the two.

We've left our position on this in a comment on a blog article (quoted here for posterity):

MIT felt more appropriate [than the open government licence] as a license for code as it’s designed for that purpose. It’s also more widely recognised in the software world and so makes it easier for other developers to make decisions about whether or not to use our code.

Fair enough, makes a lot of sense. Is that the suggested approach for other projects by government departments? Reason I'm asking is we are about to publish the template as a python egg (python-govuk-template) and I wasn't certain what licence to use.

Here's some more info on our use of MIT: https://gds-way.cloudapps.digital/manuals/licensing.html


On linux, when watching './' application closes unexpectedly

I originally wrote a small app on my Macbook, then merged and pulled onto my home Ubuntu 16.04 machine, but when I ran the node app, it closes as soon as it identifies that it's watching the current root dir.
On MacOS, the below works fine but fails in Ubuntu
var watcher = chokidar.watch('./', {
    ignored: ['node_modules', 'package.json', 'index.yaml', '.git', /(^|[\/\\])\../],
    persistent: true
});

On Ubuntu/MacOS, the following works, but adds all the files and folders as 'new' files and kicks off a mass-update of the file I'm updating when changes are made:
var watcher = chokidar.watch('.', {
    ignored: ['node_modules', 'package.json', 'index.yaml', '.git', /(^|[\/\\])\../],
    persistent: true
});

But with the above, in MacOS it detects changes, but in Ubuntu it does not detect any changes.

So in relation to chokidar not watching files at all... did some more digging and found out that if I edit files through MS Code, which is from a mapped drive on my NAS, it does not detect changes... but if I open a file a terminal, chokidar does detect the changes.
Are there known issues with GUI editors and mapped drives?

Seems like you want the ignoreInitial: true option for the issue in the first comment, and usePolling: true to fix the issue with watching files on the mapped drive.


lucide-vue-next:  Cannot redeclare block-scoped variable

Discussed in https://github.com/radix-vue/radix-vue/discussions/513

Originally posted by CassioLuis November 12, 2023
I know this is a bug with a third-party library, but I believe it's important for you to know.

I'm just npm run build my typescript project, with some components that make use of lucide-vue-next (accordion and toast components).

Hey @CassioLuis . Can you provide a minimal reproduction for this? Radix vue packages doesn't export any Icon. You sure it's related to radix-vue?

I'm sorry, this is related to the shadcn vue components, I hadn't noticed that.


Use require.resolve to load fastify

Fixes https://github.com/fastify/fastify/issues/1780.
Checklist

[x] run npm run test and npm run benchmark
[x] tests and/or benchmarks are included
[ ] documentation is changed or added
[x] commit message and code follows Code of conduct

I got tired of people asking for this to be fixed and it was a very quick fix.