Improve Errorhandling

This branch aims to improve/unify the error handling somewhat.

Should I take care of the rebasing?

Yes, please

That was slightly annoying to rebase..

thanks!


Parallel async calls are being sent sequential by default

Test Repo
Describe the bug
I have gRPC server and client written using grpc-rs. I am trying to make parallel calls to the server from the client. I expect the calls to be fired in parallel however the client seems to be sequencing them. The same implementation in go (https://github.com/senthilkumarv/grpc-rs-async/blob/master/main.go) gives me the desired output.
Here is the client code:
let async_replies: Vec<_> = (1..5).collect::<Vec<i32>>().iter().map(|index| {
    let env = Arc::new(Environment::new(5));
    let channel = ChannelBuilder::new(env).connect("<IP_ADDRESS>:50051");
    let client = GreeterClient::new(channel);
    let mut request = HelloRequest::new();
    request.name = format!("Request {}", index);
    let future = client.say_hello_async(&request)
      .into_future()
      .and_then(|client| client)
      .map(move |res| {
        let _ = client;
        println!("Reply from {}", res.message);
        res.message
      });
    Box::new(future)
  }).collect();
  let result = futures::future::join_all(async_replies)
    .wait()
    .unwrap();

Expected result (from server log)
Starting to serve Request 2
Starting to serve Request 1
Starting to serve Request 3
Starting to serve Request 4
Done servicing Request 3. Took 704ms
Done servicing Request 1. Took 705ms
Done servicing Request 4. Took 704ms
Done servicing Request 2. Took 705ms

Actual result
Starting to serve Request 3
Done servicing Request 3. Took 703ms
Starting to serve Request 2
Done servicing Request 2. Took 702ms
Starting to serve Request 4
Done servicing Request 4. Took 704ms
Starting to serve Request 1
Done servicing Request 1. Took 704ms

Workaround
I was able to achieve what I needed, by forcing new sub channels by setting a different user agents string every time I created a channel, here.
Is there a proper way to do this? Also why is the behavior different between go vs rust/grpc-core.

This is related to #179.
In summary, grpc c core will reuse the same completion queue for all requests from the same connection until exceeding the slots. It's a known problem in gRPC c core (grpc/grpc#15535), however it seems they don't have the plan to change the behavior in near future.
On the other hand, you should avoid doing any time consuming job inside the service method. You can use futures or thread pool to do the work and let completion queue focus on network related tasks.

by forcing new sub channels by setting a different user agents string every time I created a channel,

That's because gRPC c core reuse connection under the hook. When using different user agents string, it will consider it's not appropriate to reuse the same connection, so create a new one, which can utilize other completion queue.

@BusyJay Thanks for the response. I did come across this when I was googling for this issue. I see the that the C-core provides CreateCustomChannel method where you can pass channel arguments and make it look like different channel. I feel like this is cleaner than modifying user agent string per channel creation.
Is there a plan to expose this in grpc-rs?

Actually they are already supported. But they are very hacky and just for test purpose so they are hidden from docs.
https://github.com/pingcap/grpc-rs/blob/7c53f68b02cf56a5dbe042bb7d43556ac61de81a/src/channel.rs#L398-L416


Add Suffix (st, nd, rd, th) to Day-of-Month in ECharts Label Formatter

What problem does this feature solve?
ECharts' time series label formatter can show dates like "1 October 2023" using {d} {MMM} {yyyy}. But it cannot show "1st October 2023" with the "st" after the "1". It needs a new template to do this.
I suggest adding a template that will produce days of the month like 1st, 2nd, 3rd, 4th, 5th, etc.
What does the proposed API look like?
I propose adding a new template {ds} which stands for "day with suffix" and produces days of the month with the correct suffix (st, nd, rd, th) like 1st, 2nd, 3rd, 4th, 5th, etc.

I found myself needing this again today. Any chance it could be added?


OneWayToSource binding overrides TwoWay binding.

If two controls are bound to the same source property, one with a TwoWay binding and one with a OneWayToSource binding, then the TwoWay binding value will continually be overwritten by the OneWayToSource value.
See failing test in ea06593.

I had linked the wrong issue in a PR, this shouldn't have been closed.

Related:  #4438 #7760


System.UriFormatException: Invalid URI: The hostname could not be parsed'

I have a 5.0 dotnet-isolated function which I've deployed to AKS using mcr.microsoft.com/azure-functions/dotnet-isolated:3.0.15885-dotnet-isolated5.0-slim as the runtime.
When it starts up, I get the error below.
Is there a runbook for isolated functions outside of the Azure functions service?
Error
Unhandled exception. System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at Grpc.Net.Client.GrpcChannel.ForAddress(String address, GrpcChannelOptions channelOptions)
at Microsoft.Extensions.DependencyInjection.GrpcServiceCollectionExtensions.<>c.<AddGrpc>b__1_1(IServiceProvider p) in D:\a\1\s\src\DotNetWorker.Grpc\GrpcServiceCollectionExtensions.cs:line 58
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at ODE.Functions.Program.Main() in /build/src/ODE.Functions/Program.cs:line 35

Related issues 331 and 403

This happens for me as well when trying to start the host from an integration test.

@thrixton this means that, somehow, the expected arguments were not passed. Would you mind sharing the following:

The Docker file you're using (if you've crafted your own)
The logs emitted by the host showing the worker startup information (the arguments should be there as well)

@ffMathy I believe the issue you're running into is a bit different (same root, different context). Would you mind opening a separate issue so we can iterate there?
Thanks!

Hi @fabiocav ,
Thanks for taking the time to look at this.
Hopefull I've included enough info below.
 Specifically, the Program.cs file...

Not stale.

Thanks @brettsam, @ffMathy,
I've not forgotten this, we've had a lack of power and I've not had time to respond apologies.
I'm in the process of stripping it back to a workable example.
I've now got it working just using a vanilla function, I'll start overlaying my program changes on the top and provide it once I can repro it properly.
All I'm doing really in the program is setting up DI which works fine locally.
Stand by, thanks for your support and patience .

Hi @brettsam,
This seems to be an issue with the RID that I'm passing to the build command.
I manually specify linux-x64 in my publish command (dotnet publish ${BUILD_CS_PROJECT} -c Release -f ${DOTNET_TARGET_FRAMEWORK} -r ${DOTNET_RID} /p:InformationalVersion=${DOTNET_APP_VERSION} --output /build/output), when I remove this it works at runtime.
I have an example project here which illustrates this.
What should the RID be per default settings?

Thank you for sharing the details.
We're working on some samples and will look at the repro you've provided to see what is going on there. Leaving this with the Needs: Attention flag for now.

Providing an update here as we're still looking at some of the details on this. Will update when we have more information to share.

I think I found the issue, and it's due to the way command line args are passed to the function host.
On windows, the args array passed to Program.cs do not include the executable name, but on Linux it does.
It's easy enough to see:
public static void Main(string[] args)
{
  var host = Host
    .CreateDefaultBuilder()
    .ConfigureFunctionsWorkerDefaults()
    .ConfigureServices((appBuilder, services) =>
    {
      foreach (var arg in args)
      {
        Console.WriteLine(arg);
      }
    })
    .Build();

  host.Run();
}

On windows, we get:

--host
<IP_ADDRESS>
--port
59973
--workerId
bc04144e-0eb8-498d-bdca-75e4a5099fe3
--requestId
ce21fa00-35d3-44f7-84a8-619c8acee2f5
--grpcMaxMessageLength
2147483647
workerId = bc04144e-0eb8-498d-bdca-75e4a5099fe3

but on Linux, we get:

/home/site/wwwroot/FunctionApp1.dll
--host
<IP_ADDRESS>
--port
44681
--workerId
8a6e5a61-b974-45c1-a6fb-bd538566c7e9
--requestId
9a94e9d0-8dcd-4240-8142-cc842bab6668
--grpcMaxMessageLength
2147483647

Because the executable name is the first argument, the CommandLineConfigurationProvider  wrongly parses the arguments, and we end up having a configuration key / value home/site/wwwroot/FunctionApp1.dll = --host and the host name is lost.
To remediate, we can remove the first argument when creating the default host builder:
public static void Main(string[] args)
{
  var newArgs = new string[args.Length - 1];
  Array.Copy(args, 1, newArgs, 0, args.Length - 1);

  var host = Host
    .CreateDefaultBuilder(newArgs)
    .ConfigureFunctionsWorkerDefaults()
    .ConfigureServices((appBuilder, services) =>
    {
      foreach (var arg in newArgs)
      {
        Console.WriteLine(arg);
      }
    })
    .Build();

  host.Run();
}

Thank you all -- I now have a PR out which should address this: #528.


Terminal reprints path and duplicates characters when using some unicode chars on Windows

Does this issue occur when all extensions are disabled?: Yes/No

VS Code Version: 1.65.0-insider
OS Version: Windows 10 21H2

Steps to Reproduce:

Install oh-my-posh and use the theme here
Run anycommand in VSCode terminal

By installing another fresh Visual Studio Code won't solve either.
For escape sequence logging:

can you toggle screen cast mode and make a new gif of it happening?
Also, can you try this in an external terminal and confirm it doesn't happen?

Sure, here you go:

It didn't happen in external terminal:

I found the problem in my theme. In my theme, this block have a [variation selector](https://en.wikipedia.org/wiki/Variation_Selectors_(Unicode_block)) \ufe0f.
        {
          "background": "#0077c2",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "template": " PE\u2197\ufe0fKO\u2198\ufe0f "
          },
          "style": "powerline",
          "type": "text"
        },

Without the variation selector the character still renders fine, but there's no additional information about presentation.
Strangely this only happens in VSCode, remove \ufe0f and there's no more problem.

I'm experiencing this issue as well, though it's only happening with the first character. I'm using starship.
About:

Integrated Terminal:

Windows Terminal:

Confirming that I see this issue as well. Using Oh-My-Posh

(typed "abcdefg")

i have the same issue

This happens because of ambiguous width unicode symbols conflicting between vscode/xterm.js and conpty reprinting the screen. The only solution currently is to remove problem characters from your prompt.

I encountered the same problem and the duplicated characters showed up when I press tab.

I think I've also been noticing this in macos & linux vscode instances.

~ Found the suggestion here and switching to a theme without icon at the start of the line fixed the issue!

This didn't fix my issue

I found the Unicode problem in my theme. In my theme, this block have a [variation selector](https://en.wikipedia.org/wiki/Variation_Selectors_(Unicode_block)) \ufe0f.
        {
          "background": "#0077c2",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "template": " PE\u2197\ufe0fKO\u2198\ufe0f "
          },
          "style": "powerline",
          "type": "text"
        },

Without the variation selector the character still renders fine, but there's no additional information about presentation.
Strangely this only happens in VSCode, remove \ufe0f and there's no more problem.

I found the Unicode problem in my theme. In my theme, this block have a [variation selector](https://en.wikipedia.org/wiki/Variation_Selectors_(Unicode_block)) \ufe0f.
        {
          "background": "#0077c2",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "template": " PE\u2197\ufe0fKO\u2198\ufe0f "
          },
          "style": "powerline",
          "type": "text"
        },

Without the variation selector the character still renders fine, but there's no additional information about presentation.
Strangely this only happens in VSCode, remove \ufe0f and there's no more problem.

Where to find this in vscode?

i have the same problem. I have no themes and no extension installed but still the vscode terminal is doing this.

I'm going to close this since it's unfortunately not actionable by us. To clarify the issue:

xterm.js uses width of chars based on unicode spec via the terminal.integrated.unicodeVersion setting. We currently support 6 and 11 but there's a new one in the works on the xtermjs/xterm.js: A terminal for the web project
ConPTY (or Oh-My-Posh?) has it's own width for ambiguous characters like this, when reprinting the screen it sets the cursor position directly based on what it thinks the character width is but this can differ from xterm.js'/vscode's

The recommendation is still to not use ambiguous width characters in your prompt.


How to use different app id and build configurations for debug and release

I have few questions about how to create multiple build configurations for debug(UAT) and release(PROD)
I could found only this http://docs.telerik.com/platform/appbuilder/nativescript/build-configurations/application-settings article for similar topic, but there it used AppBuilder which is currently I am not using.
These are the things I am currently struggling to do.

Is it possible to create two Xcode schemes as UAT and PROD from nativescript. (I know we can easily do this in Xcode, But if I remove the platform, All the settings should be re-do)

How to use different appId for UAT and PROD environment. Can I do it in package.json?

I want to use different web server urls for those environments. How can I define it?

Anyone who has done this please share the details with me. Highly appreciated.

posted in wrong place


es6-collections implementation should be used in Safari 7.1/8

Safari 7.1 and 8 have native support for Set and Map, so es6-collections isn't used in those browsers. The Safari implementation, however, is seriously crippled because the Iterator returned by the keys, values and entries functions does not support next(). Because these are common functions, the native implementation can not be used reliably:
m = new Map();
m.set(1, "test");
m.set("2", false);
it = m.values(); // returns Map Iterator
it.next(); // TypeError: undefined is not a function

In this case, the es6-collections implementation should be used over the native one, or at least the option to force it should be present.

+1

https://github.com/Steditor/es6-collections-iterators can be used to patch the key, values and entries functions.
We still have to discuss, whether forcing the whole es6-collections polyfill or patching solely the broken methods is better - I'd like to stick to the native implementation where possible, but that might maybe introduce more problems in some cases.

actually a good point, using native is always usually better/faster/etc.etc ... but in case of WeakMap there's no way this poly would bring any benefit compared to the native one.
How would you like a partial fix for Safari that  won't fix WeakMap anyway? It seems like maybe Safari needs indeed a fix for its own  broken thing only, I will think about a solution here too.

scratch that,  WM doesn't need iterators ^_^

@WebReflection The latest version of https://github.com/Steditor/es6-collections-iterators also fixes Safari!

current 0.5.2 version of this one fixes Safari too


Does not properly parse IE 11 in compatibility mode

The following user agent is for IE 11 but parses as IE 10. In compatibility mode, the Trident version still corresponds to IE 11 (4 versions behind).
Mozilla/5.0 (compatible%3B MSIE 10.0%3B Windows NT 6.1%3B WOW64%3B Trident/7.0%3B)
And here is a short MS blog about IE 11 user agents. https://blogs.msdn.microsoft.com/ieinternals/2013/09/21/internet-explorer-11s-many-user-agent-strings/
I'll give this issue a try.

@laurawhalin I believe you and I have discussed this before but the issue isn't with this library, it's with the underlying pattern file managed by BrowserScope.
If you run the same User-Agent through the Ruby UA library you'll get the same results:
➜  example git:(master) ✗ pry
[1] pry(main)> require 'user_agent_parser'
=> true
[2] pry(main)> ua = UserAgentParser.parse("Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/7.0;)")
=> #<UserAgentParser::UserAgent IE 10.0 (Windows 7) (Other)>
[3] pry(main)> ua.to_s
=> "IE 10.0"

@laurawhalin here is a previous issue I created when I encountered a number of issues with User-Agents, they were all tied to the underlying pattern file: https://github.com/doomspork/ua_parser/issues/12


Kotlin stats command

Is this still needed? If yes, I request an elaboration on what exactly the Kotlin stats command is supposed to do?

Thank you for expressing your interest here. But the repo is not active anymore and the issues here are stale.


The order of reading css changes when node_env ='production'

Versions

nuxt: v2.15.6
node: v14.15.3

Reproduction

sorry. Cannot be linked because it is a company repository.

Additional Details

Steps to reproduce

create customComponent.
Define a style in the style tag in customComponent.
Call a customComponent from index.vue
Define class from index.vue side in the called custom component.
Local and staging take precedence over css defined in index.vue (staging NODE_ENV='staging')

package.json
"script": {
  "generate:production": "cross-env NODE_ENV=production nuxt generate"
}

terminal
$ yarn generate:production

What is Expected?
Must be in the same style as staging
What is actually happening?
But production doesn't.
CustomComponent style has been prioritized.
What to do.
thank you.

@danielpost
thunk you
The structure of the style tag is as follows
<style lang="stylus" scoped>
</style>

<template lang="pug">
.child
</template>

<style lang="stylus" scoped>
.child {
  height: 600px
}
</style>

<template lang="pug">
.parent
  child.child-component
</template>

<script>
import Child from './child'

export default {
  components: {
    Child
  }
}
</script>

<style lang="stylus" scoped>
.child-component {
  height: 800px
}
</style>

@danielroe
Sorry to keep bothering you.
At this time, if node_env is production, height: 600px will be applied, so
Is it necessary to add important to the parent's style or not to add the same style as the child?

ok.

@danielroe
Thank you,
Also, I was able to solve it by the following method
nuxt.config.js
build: {
  extractCSS: true,
  optimization: {
    splitChunks: {
      cacheGroups: {
        styles: {
          name: 'styles',
          test: /\.(css|vue|styl)$/,
          chunks: 'all',
          enforce: true,
        },
      },
    },
  },
}


Fix discoverability of bash interactive

Pull Request Test Coverage Report for Build<PHONE_NUMBER>
Details

0 of 0   changed or added relevant lines in 0 files are covered.
14 unchanged lines in 3 files lost coverage.
Overall coverage decreased (-0.2%) to 74.307%

Files with Coverage Reduction
New Missed Lines
%

foundationdb/src/database.rs
1
56.76%

foundationdb-bindingtester/src/main.rs
5
88.41%

foundationdb/src/directory/directory_layer.rs
8
92.13%

Totals

Change from base Build<PHONE_NUMBER>:
-0.2%

Covered Lines:
4344

Relevant Lines:
5846

💛  - Coveralls

Fair point, I don't know how this interacts with other shells. Let's close this as it's not cumbersome to apply the fix locally.


Support for Jasmine CLI and Jasmine module

Unit testing boilerplate for ES6 JS. The configuration always points to the build, nothing else.. so you can run jasmine as a command like you normally would if it is globally installed. If not, that's fine.. I added a simple gulp task (gulp test) that encapsulates the jasmine module itself as well. so there's literally no excuse to not unit test ;)
This is tested against actual unit tests I'll be pushing btw
@mok4ry @Lettuceman44

:+1:


WIP add upgrade config

Describe what this PR does / why we need it
Does this pull request fix one issue?
Fixes #1428

Describe how you did it
Describe how to verify it
Special notes for reviews

I only make a test in VM environment with k8s version 1.18.8, need more test with different CloudImages and scene

Codecov Report

Merging #1529 (e862793) into main (fb7f0f2) will increase coverage by 0.18%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1529      +/-   ##
==========================================
+ Coverage   10.68%   10.86%   +0.18%
==========================================
  Files          84       88       +4
  Lines        7640     8015     +375
==========================================
+ Hits          816      871      +55
- Misses       6721     7037     +316
- Partials      103      107       +4

Impacted Files
Coverage Δ

pkg/runtime/upgrade.go
0.00% <0.00%> (ø)

apply/scale.go
7.74% <0.00%> (-0.85%)
:arrow_down:

apply/run.go
0.00% <0.00%> (ø)

apply/apply.go
0.00% <0.00%> (ø)

pkg/runtime/masters.go
0.00% <0.00%> (ø)

utils/net/cidr.go
0.00% <0.00%> (ø)

apply/validate.go
87.50% <0.00%> (ø)

utils/net/iputils.go
18.27% <0.00%> (ø)

utils/net/route.go
0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb7f0f2...e862793. Read the comment docs.


Can't install the package

Hello, I came across your publication on DiffChIPL and would like to try it out!
I'm having trouble though to install it:

if I try through RStudio with CRAN I get this error:
Warning in install.packages : package ‘DiffChIPL’ is not available (for R version 4.0.0)
if I try with install_github("yancychy/DiffChIPL") I get this:

Error: Failed to install 'unknown package' from GitHub:
HTTP error 404.
No commit found for the ref master
Did you spell the repo owner (`yancychy`) and repo name (`DiffChIPL`) correctly?
If spelling is correct, check that you have the required permissions to access the repo.

I've tried with R versions 4.0, 4.1 and 4.2.
Please let me know if you have an idea how to solve this!
Thank you,
Chris

Hi Chris,
I will fix it today. Please download the package to your computer and install it in Rstudio directly. I just install it in my computer. At first, I failed. But after I installed some packages, it worked.
Best,
Yang

Hi Chris,
I tested it in a new OS which has only some packages installed. The error is as follows:
Installing package into ‘/Users/chens19/Library/R/x86_64/4.1/library’ (as ‘lib’ is unspecified) ERROR: dependencies ‘limma’, ‘edgeR’, ‘GenomicRanges’, ‘Rsamtools’, ‘bamsignals’, ‘SGSeq’, ‘aomisc’ are not available for package ‘DiffChIPL’ *removing ‘/Users/chens19/Library/R/x86_64/4.1/library/DiffChIPL’ Warning messages: 1: packages ‘aomisc’, ‘SGSeq’, ‘bamsignals’, ‘Rsamtools’, ‘GenomicRanges’, ‘edgeR’, ‘limma’ are not available for this version of R
Then I just installed these pacakges and reinstall DiffChIPL.
For example:
BiocManager::install("SGSeq", lib="/Users/chens19/Library/R/x86_64/4.1/library/")

Hi Yang,
Thanks a lot for checking this, I will try installing the other packages first as you suggest.
BW
Chris


M5stickc Plus 2 problems

Ciao a tutti. Premetto che utilizzo da anni una m5stickc, che ho programmato con il software visual studio. Non ho avuto alcun problema. Letture precise di tutti i sensori espaltherma. Ho comprato da poco una nuova m5stickc plus 2, che ho pensato di tenere di scorta nel caso la prima chiavetta dovesse non funzionare più.  Ho formattato la m5stickcplus usando m5burner e uniflow dedicato al modello corretto, ho fatto upload del progetto selezionando la porta com corretta e come modello, non essendoci la plus 2, ho messo m5stickc plus. la procedura ha esito positivo, non ci sono errori e la scrittura sulla chiavetta va a buon fine. però non riesco a vederla online all'interno dei dispositivi collegati al router. Quale può essere il problema? Ringrazio chi si prenderà il tempo di rispondermi.
Hi everyone. Let me start by saying that I have been using an m5stickc for years, which I programmed with the visual studio software. I didn't have any problems. Precise readings of all espaltherma sensors. I recently bought a new m5stickc plus 2, which I thought I'd keep as a spare in case the first stick no longer works. I formatted the m5stickcplus using m5burner and uniflow dedicated to the correct model, I uploaded the project by selecting the correct com port and as the model, since there was no plus 2, I put m5stickc plus. the procedure is successful, there are no errors and the writing on the flash drive is successful. but I can't see it online within the devices connected to the router. What could be the problem? I thank those who take the time to answer me.

I am new user of this project and I'm also having same problem. Also, screen is not showing any information after uploading, which I believe i should.
Following this issue

Same here - found another thread that says the code doesn’t work on the Plus 2, can we get a view if it’s in the roadmap before I return the plus 2? Thanks.

I'll have a look.
Please open the serial monitor and paste the logs from the device.

I'll have a look. Please open the serial monitor and paste the logs from the device.

Thanks
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 271414342, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13232
load:0x40080400,len:3028
entry 0x400805e4
My little bit of research says that M5StickC PLUS2 is an iterative version of M5StickC PLUS, featuring the ESP32-PICO-V3-02 chip, I also found someone saying on a forum the display pinout was different.
Thanks for looking.

Looks like there is no program on your device.
Can you paste the upload process?

Dependency Graph
|-- M5StickCPlus @ 0.1.0
|-- PubSubClient @ 2.8.0
|-- ArduinoOTA @ 2.0.0
|-- WiFi @ 2.0.0
|-- EEPROM @ 2.0.0
Building in release mode
Retrieving maximum program size .pio/build/m5stickcplus/firmware.elf
Checking size .pio/build/m5stickcplus/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==        ]  17.2% (used 56260 bytes from 327680 bytes)
Flash: [=======   ]  65.8% (used 862801 bytes from 1310720 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, esp-bridge, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Using manually specified: /dev/cu.usbserial-568A0021941
Uploading .pio/build/m5stickcplus/firmware.bin
esptool.py v4.5.1
Serial port /dev/cu.usbserial-568A0021941
Connecting..........
Chip is ESP32-PICO-V3-02 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, Embedded PSRAM, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: e8:9f:6d:31:3f:54
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x000e4fff...
Compressed 17536 bytes to 12202...
Writing at 0x00001000... (100 %)
Wrote 17536 bytes (12202 compressed) at 0x00001000 in 1.5 seconds (effective 92.2 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 335.4 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 455.9 kbit/s)...
Hash of data verified.
Compressed 869104 bytes to 554088...
Writing at 0x00010000... (2 %)
Writing at 0x00019d94... (5 %)
Writing at 0x0002589f... (8 %)
Writing at 0x000323f2... (11 %)
Writing at 0x0003d9c4... (14 %)
Writing at 0x0004371e... (17 %)
Writing at 0x00048c39... (20 %)
Writing at 0x0004e501... (23 %)
Writing at 0x00053ae6... (26 %)
Writing at 0x0005911c... (29 %)
Writing at 0x0005e28a... (32 %)
Writing at 0x00063553... (35 %)
Writing at 0x00068821... (38 %)
Writing at 0x0006da98... (41 %)
Writing at 0x00072d91... (44 %)
Writing at 0x000781a6... (47 %)
Writing at 0x0007d42e... (50 %)
Writing at 0x00082fb0... (52 %)
Writing at 0x000887a4... (55 %)
Writing at 0x0008db36... (58 %)
Writing at 0x00092e6c... (61 %)
Writing at 0x00098255... (64 %)
Writing at 0x0009d870... (67 %)
Writing at 0x000a2e8d... (70 %)
Writing at 0x000a8635... (73 %)
Writing at 0x000ae592... (76 %)
Writing at 0x000b3eb9... (79 %)
Writing at 0x000b9819... (82 %)
Writing at 0x000be8ec... (85 %)
Writing at 0x000c6f39... (88 %)
Writing at 0x000cf4bd... (91 %)
Writing at 0x000d4613... (94 %)
Writing at 0x000da10e... (97 %)
Writing at 0x000df580... (100 %)
Wrote 869104 bytes (554088 compressed) at 0x00010000 in 53.4 seconds (effective 130.1 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
====================================================== [SUCCESS] Took 62.23 seconds ======================================================
Environment    Status    Duration

m5stickcplus   SUCCESS   00:01:02.234
====================================================== 1 succeeded in 00:01:02.234 ======================================================

Terminal will be reused by tasks, press any key to close it.

I've made a fork and added support for M5Stick Plus2
https://github.com/smart40-githib/ESPAltherma
It seems to work fine  so far as I can tell as I won't be opening the heatpump until the summer.
There is a pull request to merge into this repo.

I've made a fork and added support for M5Stick Plus2 https://github.com/smart40-githib/ESPAltherma
It seems to work fine so far as I can tell as I won't be opening the heatpump until the summer.
There is a pull request to merge into this repo.

Thank - sorry noob here.
I've downloaded your fork, and pushed to my plus 2, but nothing different. What should the Env: be set to?
Thanks for your help.

@smart40-githib for me it also seem to work now, I see 2 new entities in HA(AlthermaSensor and AlthermaSwitch). I will try to connect to my heatpump tomorrow. Thanks!
--- Terminal on COM3 | 115200 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
Querying register 0x20... Time out! Check connection
Querying register 0x21... Time out! Check connection
Retrying...
Querying register 0x21... Time out! Check connection
Retrying...
Querying register 0x21... Time out! Check connection
Retrying...

Same here - thank you.
Will this get put into the main repo next?

Morning, I can see an entity - sensor.none_althermasensors, however, it has no attributes, other than 'Online'.
I've uninstalled and re-installed MQTT - and get the same issues.
However, if I listen to the topics in MQTT, I can see all the data coming from the heatpump.

Might have found my problem - although not sure how to fix it.

Fixed the syntax error and battery voltage value.
Can you try again please.

Fixed the syntax error and battery voltage value. Can you try again please.

Thanks, just copied mqtt.h across to my deployment, and seems to be working fine.

It seems to work and for that I am very grateful. However, the black screen problem persists. I don't understand why. I made this request for help for a friend. Now its works perfectly and the screen works too. In my case however the screen remains black. This also happened to me on the M5stickcplus, but the latter still works perfectly (I don't care much about having a working screen). I was hoping that in the m5stickcplus 2 the screen would work.

I am new user of this project and I'm also having same problem. Also, screen is not showing any information after uploading, which I believe i should. Following this issue

Have you solved the black screen problem?

The should come on and then turn off after 30 seconds. If you press the button on the front it should come on for another 30 seconds. Other than that I cannot help.

No answer? I guess it's solved by now.


Only QOS0 retained messages are received by the client upon subscription.

Describe the bug
Retained messages published with other than QOS 0 aren't received by the client upon subscription.
Which component is your bug related to?

Server

To Reproduce
See code example.
Expected behavior
Upon subscription client will received all retained messages not only ones with QOS 0.
Code example
using System.Text;
using MQTTnet;
using MQTTnet.Client;
using MQTTnet.Diagnostics;
using MQTTnet.Packets;
using MQTTnet.Protocol;

// prepare server
var logger = new MqttNetEventLogger();
logger.LogMessagePublished += (_, eventArgs) =>
{
    Console.WriteLine(eventArgs.LogMessage.Message);
};
var factory = new MqttFactory(logger);
var serverOptions = factory.CreateServerOptionsBuilder()
    .WithDefaultEndpoint()
    .Build();
var mqttServer = factory.CreateMqttServer(serverOptions);

await mqttServer.StartAsync();

var clientOptions = factory.CreateClientOptionsBuilder()
    .WithTcpServer("<IP_ADDRESS>", 1883)
    .WithCleanSession()
    .Build();

// publish retained message
var writeClient = factory.CreateMqttClient();

await writeClient.ConnectAsync(clientOptions);
await writeClient.PublishAsync(new MqttApplicationMessage
{
    Topic = "test_topic/0",
    Payload = Encoding.UTF8.GetBytes(@"{""hello"":0}"),
    Retain = true,
    QualityOfServiceLevel = MqttQualityOfServiceLevel.AtMostOnce
});
await writeClient.PublishAsync(new MqttApplicationMessage
{
    Topic = "test_topic/1",
    Payload = Encoding.UTF8.GetBytes(@"{""hello"":1}"),
    Retain = true,
    QualityOfServiceLevel = MqttQualityOfServiceLevel.AtLeastOnce
});
await writeClient.PublishAsync(new MqttApplicationMessage
{
    Topic = "test_topic/2",
    Payload = Encoding.UTF8.GetBytes(@"{""hello"":2}"),
    Retain = true,
    QualityOfServiceLevel = MqttQualityOfServiceLevel.ExactlyOnce
});
await writeClient.DisconnectAsync();

// create new client and subscribe
var readClient = factory.CreateMqttClient();

readClient.ApplicationMessageReceivedAsync += eventArgs =>
{
    Console.WriteLine($"message received {eventArgs.ApplicationMessage.Topic}");
    return Task.CompletedTask;
};

await readClient.ConnectAsync(clientOptions);
await readClient.SubscribeAsync(new MqttTopicFilter
{
    Topic = "test_topic/+",
    QualityOfServiceLevel = MqttQualityOfServiceLevel.ExactlyOnce
});

// give it some time
await Task.Delay(5000);

await readClient.DisconnectAsync();
await mqttServer.StopAsync();

Please test with version <IP_ADDRESS> from the MyGet feed (see Readme). I fixed the issue in this version. If it works I will release a hotfix version soon.

It works as expected with <IP_ADDRESS>.

Sorry not sure it it was supposed to be closed by me so I reopen it.


fix(opensearch-provider): fix working with opensearch 2.x.x

Signed-off-by: serge-r<EMAIL_ADDRESS>Description
Hello!
Some time ago, I tried to use this provider to support our Opensearch 2.4.0 infrastructure in Terraform. But I have found the next problems:

version mismatch problem - Opensearch is using different version numbers, instead of Elasticsearch, but this provider is checking it only for Elastic, which makes this provider not usable for Opensearch.
deprecated API for index templates - elastic7.client.IndexDeleteTemplate and elastic7.client.IndexGetTemplate are deprecated functions and lead to problems during usage, I have changed it to actual versions.
elastic6 support - I'm not sure, that elastic6 lib is actually for Opensearch because Opensearch has been made from Elasticsearch 7 versions. I also didn't find info about API compatibility with Elasticsearch version 6. I have removed the version-checking mechanism in this PR, and it makes elastic6 lib unusable. I preferred to remove elastic6 lib too.

Perhaps there are more problems, but at this time I have tested only Indexes and IndexTemplates resources.
I know also about https://github.com/phillbaker/terraform-provider-elasticsearch, which this provider was forked from, but I think, that is more about Elasticsearch, not Opensearch. Unfortunately, this provider also has the same problems with version detection.
Please say what are you thinking about this PR. And also big thanks for your and Phillbaker's work!
Issues Resolved

version mismatch problem
deprecated API for index templates

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

can we see this PR merged soon ?

Hey thanks for the PR @serge-r and apologies for the long wait, ready to roll.
@serge-r can you please fix the conflicts and we can merge this PR @phillbaker can you please review ?
Thank you
@bbarani @peterzhuamazon

Thank you guys and sorry for delay, I will check and send a response ASAP

For use the resources opensearch_index_template and opensearch_dashboard_object are not working:
resource "opensearch_index_template" "index_template" {
  for_each = var.indices
  name     = each.key
  body     = <<EOF
{
  "index_patterns": ["${each.key}*"],
  "template" : {
    "settings": {
      "plugins.index_state_management.rollover_alias": "${each.key}"
   }
  }
}
EOF
}

resource "opensearch_dashboard_object" "index_pattern" {
  for_each = var.indices
  body     = <<EOF
[
  {
    "_id": "index-pattern:${each.key}",
    "_type": "",
    "_source": {
      "type": "index-pattern",
      "index-pattern": {
        "title": "${each.key}-*",
        "timeFieldName": "@timestamp"
      }
    }
  }
]
EOF
}

Happy to test when fixes are implemented.

Hello guys!
I have pushed fixed version. Please review.
@andrejvanderzee I tested opensearch_dashboard_object and  opensearch_index_template with self-hosted opensearch and dashboard version 2.3, everything working normally. Unfortunately I have no ability to test it with AWS opensearch.
I think that need to use this version carefully, because Opensearch can use different API - at this time this provider using elastic7 library. Perhaps it will work better with native opensearch go lib.

@serge-r We have upgraded to AWS Opensearch 2.5 but still same behavior: The terraform applies, but afterwards:
GET _index_template
{
  "index_templates": []
}

@serge-r The index templates are correctly created with your fork on AWS Opensearch 2.5. But, it keeps giving me changes though:
  # opensearch_index_template.index_template["kube-shared"] will be updated in-place
  ~ resource "opensearch_index_template" "index_template" {
      ~ body = jsonencode(
          ~ {
              + index_patterns  = [
                  + "kube-shared*",
                ]
              - index_templates = [
                  - {
                      - index_template = {
                          - index_patterns = [
                              - "kube-shared*",
                            ]
                          - template       = {
                              - settings = {
                                  - index = {
                                      - number_of_replicas = "1"
                                      - number_of_shards   = "1"
                                      - plugins            = {
                                          - index_state_management = {
                                              - rollover_alias = "kube-shared"
                                            }
                                        }
                                      - refresh_interval   = "60s"
                                    }
                                }
                            }
                        }
                      - name           = "kube-shared"
                    },
                ] -> null
              + template        = {
                  + settings = {
                      + index                                           = {
                          + number_of_replicas = 1
                          + number_of_shards   = 1
                          + refresh_interval   = "60s"
                        }
                      + "plugins.index_state_management.rollover_alias" = "kube-shared"
                    }
                }
            }
        )
        id   = "kube-shared"
        name = "kube-shared"
    }

@serge-r The problem is with keeping appplying non-changes while it is applied, on AWS you soon run into errors such as the below (for opensearch_index, which gives similar problem in the official beta-release):
Error: elastic: Error 429 (Too Many Requests): index [kubernetes-events-dev-000001] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block]; [type=cluster_block_exception]
│
│   with opensearch_index.bootstrap["kubernetes-events-dev"],
│   on indices.tf line 19, in resource "opensearch_index" "bootstrap":
│   19: resource "opensearch_index" "bootstrap" {

Would be nice if the above can be fixed.

@phillbaker @prudhvigodithi @peterzhuamazon @jackson-theisen Can someone please review? Looks good to me at least until the Opensearch Go client is used by this provider.

Hey @serge-r I see the tests are failing also, I assume the PR is not rebased can you please check? Also @phillbaker can you add your initial thoughts on this?
Thank you
@peterzhuamazon @bbarani

Thank you for the contribution. Right now, I'd like to focus on getting a v1 of this provider out the door. I'm happy to fully review this once that happens.
At a high level, this PR is pretty large and widely impacting. It should be broken up into separate PRs, one for each major change. E.g. a first PR for dropping elasticsearch 6 support, a second PR for deprecated API for index templates, etc. Those smaller PRs will also make merging individual fixes easier without having to wait for the entire PR to be ready.
Overall, these changes will need to have appropriate updates to the tests.

@serge-r Do you have an example of opensearch_dashboard_object that works for you? This does not work for me:
resource "opensearch_dashboard_object" "index_pattern" {
  for_each = var.indices
  body     = <<EOF
[
  {
    "_id": "index-pattern:${each.key}",
    "_type": "_doc",
    "_source": {
      "type": "index-pattern",
      "index-pattern": {
        "title": "${each.key}-*",
        "timeFieldName": "@timestamp"
      }
    }
  }
]
EOF
}

It applies, but in AWS Opensearch 2.5 I see now saved object / index pattern.

Hello!
Sorry for delay, unfortunately I can't spend many times on it(
Removing elastic6 it's already huge amount of changes, but I understand the problem and try to divide the PR to small PRs.
@andrejvanderzee about consistent changing errors - I will check, thank you for the info
about problem with opensearch_dashboard_object - check please which index in AWS using for store dashboard objects, perhaps it have different name. Default index in provider is ".dashboard". In AWS it can be ".kibana" or any other name. You can set dashboards index via index field in the resource like
resource "opensearch_dashboard_object" "index_pattern" {
  index = ".kibana"
  for_each = var.indices
  body     = <<EOF
[
  {
    "_id": "index-pattern:${each.key}",
    "_type": "_doc",
    "_source": {
      "type": "index-pattern",
      "index-pattern": {
        "title": "${each.key}-*",
        "timeFieldName": "@timestamp"
      }
    }
  }
]
EOF
}

Thanks @serge-r adding index = ".kibana" made it work.

Any thoughts on when this might get merged and a new version made available?

At a high level, this PR is pretty large and widely impacting. It should be broken up into separate PRs, one for each major change. E.g. a first PR for dropping elasticsearch 6 support, a second PR for deprecated API for index templates, etc. Those smaller PRs will also make merging individual fixes easier without having to wait for the entire PR to be ready.
Overall, these changes will need to have appropriate updates to the tests.

Hey @serge-r based on @phillbaker suggestion, can you please split the changes into different PR's and adding unit tests for each of them? I have created an issue to track the 2.x support https://github.com/opensearch-project/terraform-provider-opensearch/issues/39 please check. Also if you are ok we can close this PR and move forward with smaller PRs that can track 2.x support.
Thank you
@bbarani @peterzhuamazon @rishabh6788

Hello guys, and sorry for waiting. I have made new PR with less amount of changes, please review.
https://github.com/opensearch-project/terraform-provider-opensearch/pull/41

+1

@prudhvigodithi @phillbaker Can someone please take a look at this PR please?

What is the minimum change necessary to support Opensearch 2.x.x? Is it just this?:

version mismatch problem - Opensearch is using different version numbers, instead of Elasticsearch, but this provider is checking it only for Elastic, which makes this provider not usable for Opensearch.

Or do we need the Elastic 6/7 deprecations as well to support Opensearch 2.x.x?

totally appreciate everyone's time in the open source project, any updates on this?

Any news?

This would be huge for those in the community running OpenSearch 2.x.x

Closing this PR, please check the latest PR that has all the support for 2.x https://github.com/opensearch-project/terraform-provider-opensearch/pull/62.
Thank you

Hey All, we just released the Beta version of OpenSearch Terraform Provider with 2.x support. We aim to release the non-beta version based on the feedback. Additionally, we encourage and welcome contributions from the community. If you come across any issues or wish to expand the coverage of APIs, we invite you to contribute to the project.
Provider Download link: https://registry.terraform.io/providers/opensearch-project/opensearch/2.0.0-beta.1
Thank you


Single sign out question

I have a simple client that uses implicit flow. It works, but i have a question about session management.
If i open 2 tabs in browser, each authenticated as some user and logout from one of them  - got this behavior on another tab:
CheckSessionIFrame: changed message from check session op iframe
main.9d15ec08.js:1 CheckSessionIFrame.stop
main.9d15ec08.js:1 UserManager._signinStart: got navigator window handle
main.9d15ec08.js:1 OidcClient.createSigninRequest

And because of signin request - still autheticated.
Is it mean that i should subscribe for userSignedOut (`https://github.com/IdentityModel/oidc-client-js/wiki#events)?

yes, handle the logout with the event specified in the docs which you mentioned. Then you can call signoutRedirect()  within the event to make sure the signed in tabs are notified.

You can also disable SLO notification.


failed during "vagrant up"

Getting this error:
Fetching 'mesos' from git://github.com/everpeace/cookbook-mesos.git (at master)
Fetching cookbook index from https://supermarket.getchef.com...
Error retrieving universe from source: https://supermarket.getchef.com

[Berkshelf::APIClient::TimeoutError] Unable to connect to: https://supermarket.getchef.com
stderr: Required artifacts do not exist at the desired version
Missing artifacts: apt
Unable to find a solution for demands: apt (>= 0.0.0), docker (0.37.0), mesos (0.2.2)

Direct cause is "Unable to connect to: https://supermarket.getchef.com" as your output said.
However "https://supermarket.getchef.com" doesn't seem to be down.
Please check your network configuration.

@meirwah Do you still have this problem??  Would you mind closing this issue?


Tutorial for beginners

Hey Boyd,
Really liking the look of your library! I am just getting started with Elixir & Phoenix and I am in need of a auth-z package.
I have had a look through your docs and they look great. I am just having a bit of trouble grasping in what order to do things and how each part is supposed to be used.
I think it would really help me if I could read a blog post or see an example app that just covers the basics.
I would really appreciate if you could do something like this but understand if you're too busy to make it happen :)
Thanks,
Alaister

Turns out I am working on a tutorial, but it is still in draft form.
Please take a read of the current version and let me know any feedback you have. I'm planning to do another pass on it over the weekend...
<EMAIL_ADDRESS>

For MyApp.Policies, there are undefined function errors for put_flash, redirect, session_path.

Thank you for pointing that out. Am re-working that part of the tutorial. Well... most of it really.

Thanks @boydm! Really good.
I have a beginner question though, why do you want to encrypt user permissions in the DB?

Good question. Think defense...
Assume a hacker has gained access to the db via a side channel. If they can write permissions into the field, you are hosed as they are your new admin. If a disgruntled employee can write those values, they too are your new admin. I know of both happening on real products...
Encrypting the values means they need access to both the db and the keys, which should be stored separately.
For that matter, also encrypt email addresses, phone numbers or any other identifying information.

I'll probably publish it for real tomorrow. Also made a change in Policy Wonk, so you won't need to recompile it to pick up config changes any more. Probably publish that tomorrow as well. Maybe Friday...

Ahh of course, I was only thinking in terms of a hacker reading the values for some reason. Silly me!
I am implementing policy wonk into my app right now! 😄

What is the best way to write a policy to ensure a resource is owned by the current_user and is called when in a phoenix action? (Essentially comparing the :current_user.id with the_resource.id

First, make sure the current user and the resource are loaded. Then write a policy sort of like this...
def policy(assigns, :ensure_owner) do
if assigns.thing.owner_id == assigns.current_user.id do
:ok
else
:unauthorized
end
end

Sorry that didn't preserve formatting. Is simple enough to figure out.
Anyway, tutorial is now published publicly, I'm closing the issue...


spi_master driver cannot support transation with Tx length==0

Hi,
I'm having a transation wrap around spi_master as below:
`uint8_t my_transaction(uint8_t sendBytes, uint8_t *pDin, uint8_t recvBytes, uint8_t *pDout){
esp_err_t ret;
spi_transaction_t t;
memset(&t, 0, sizeof(t));
t.length=sendBytes*8;
t.rxlength = recvBytes*8;
t.tx_buffer = pDin;
t.rx_buffer = pDout;
ret=spi_device_transmit(handle, &t);
TEST_ASSERT(ret==ESP_OK);

return 0;
}`
When sendBytes>0, this function works OK as epxected, but when sendBytes==0, it was not doing anything by calling this function. I believe this is not a right behavior, can someone help take a deep look inside? thanks,

Found the problem and having a fix below looks like a typo to me:
`diff --git a/components/driver/spi_master.c b/components/driver/spi_master.c
index 6162edb..8f6779f 100644
--- a/components/driver/spi_master.c
+++ b/components/driver/spi_master.c
@@ -655,7 +655,7 @@ static void IRAM_ATTR spi_intr(void *arg)
host->hw->addr=trans->address & 0xffffffff;
}
host->hw->user.usr_mosi=(trans->tx_buffer==NULL)?0:1;

   host->hw->user.usr_miso=(trans->tx_buffer==NULL)?0:1;

   host->hw->user.usr_miso=(trans->rx_buffer==NULL)?0:1;

   //Call pre-transmission callback, if any
   if (dev->cfg.pre_cb) dev->cfg.pre_cb(trans);

`

what about
https://github.com/espressif/esp-idf/blob/master/components/driver/spi_master.c#L627
if (trans->rxlength < 8*32) {
                //No need for DMA.
                for (int x=0; x < trans->rxlength; x+=32) {

Should be length instead of rx_length?

@Spritetm had a chance to check this?

Should be fixed when the MR for #336 is merged. Closing this issue for now, please discuss in #336 if you have more issues.


BUG[NewTimer leaks]

the problem exists for all versions of elastic clients, both 1.x and 2.x
Steps to reproduce the behavior:
write a dead-loop to create stack-local es-clients and let them alone(let the gc deal with them), by opening the pprof port,  you will see
3625.5  95.6%  95.6%   3783.4  99.8% time.NewTicker
something like above
Why it happens?
According to go's official document and code comments, the Ticker object can not be collected by gc unless the Stop method is called. Unfortunately, code in both 1.x and 2.x did not call Stop anywhere.
see client.go:sniffer(), client.go:healthchecker()

@wolfkdy Thanks for reporting. Yes, that's wrong. I will fix it when I find some time, hopefully next weekend.

@wolfkdy Would you please review the changes in the above commit?

I review it carefully and think it enough to fix the bug.
Btw, will you merge the patch into earlier versions ?

I will merge into v2 as well. When you then go get gopkg.in/olivere/elastic.v2 (or v3) again, then the fix is in.

Merged into v3 in this commit. v2 should follow up shortly.


XCTestCase.fulfillment(…) missing on Linux

Hi folks,
It looks like the fulfillment(…) methods on XCTestCase and XCTWaiter are both missing on Linux.
It would be helpful to have API parity here, as Xcode 14.3 complains if I use the older wait(…) methods:
Instance method 'wait' is unavailable from asynchronous contexts; Use await fulfillment(of:timeout:enforceOrder:) instead; this is an error in Swift 6

Here are the missing methods:
extension XCTestCase {

    /// Waits on a group of expectations for up to the specified timeout,
    /// optionally enforcing their order of fulfillment.
    ///
    /// - Parameters:
    ///     - expectations: An array of expectations that must be fulfilled.
    ///     - seconds: The number of seconds within which all expectations must
    ///         be fulfilled. The default timeout allows the test to run until
    ///         it reaches its execution time allowance.
    ///     - enforceOrderOfFulfillment: If `true`, the expectations specified
    ///         by the `expectations` parameter must be satisfied in the order
    ///         they appear in the array.
    ///
    /// Expectations can only appear in the list once. This function may return
    /// early based on fulfillment of the provided expectations.
    ///
    /// - Note: If you do not specify a timeout when calling this function, it
    ///     is recommended that you enable test timeouts to prevent a runaway
    ///     expectation from hanging the test.
    @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
    @nonobjc public func fulfillment(of expectations: [XCTestExpectation], timeout seconds: TimeInterval = .infinity, enforceOrder enforceOrderOfFulfillment: Bool = false) async
}

extension XCTWaiter {

    /// Waits on a group of expectations for up to the specified timeout,
    /// optionally enforcing their order of fulfillment.
    ///
    /// - Parameters:
    ///     - expectations: An array of expectations that must be fulfilled.
    ///     - seconds: The number of seconds within which all expectations must
    ///         be fulfilled. The default timeout allows the test to run until
    ///         it reaches its execution time allowance.
    ///     - enforceOrderOfFulfillment: If `true`, the expectations specified
    ///         by the `expectations` parameter must be satisfied in the order
    ///         they appear in the array.
    ///
    /// - Returns: A value describing the outcome of waiting for `expectations`.
    ///
    /// Expectations can only appear in the list once. This function may return
    /// early based on fulfillment of the provided expectations.
    ///
    /// - Note: If you do not specify a timeout when calling this function, it
    ///     is recommended that you enable test timeouts to prevent a runaway
    ///     expectation from hanging the test.
    @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
    @discardableResult
    @nonobjc public func fulfillment(of expectations: [XCTestExpectation], timeout seconds: TimeInterval = .infinity, enforceOrder enforceOrderOfFulfillment: Bool = false) async -> XCTWaiter.Result

    /// Creates a waiter that waits on a group of expectations for up to the
    /// specified timeout, optionally enforcing their order of fulfillment.
    ///
    /// - Parameters:
    ///     - expectations: An array of expectations that must be fulfilled.
    ///     - seconds: The number of seconds within which all expectations must
    ///         be fulfilled. The default timeout allows the test to run until
    ///         it reaches its execution time allowance.
    ///     - enforceOrderOfFulfillment: If `true`, the expectations specified
    ///         by the `expectations` parameter must be satisfied in the order
    ///         they appear in the array.
    ///
    /// - Returns: A value describing the outcome of waiting for `expectations`.
    ///
    /// Expectations can only appear in the list once. This function may return
    /// early based on fulfillment of the provided expectations.
    ///
    /// The waiter is discarded when the wait completes.
    ///
    /// - Note: If you do not specify a timeout when calling this function, it
    ///     is recommended that you enable test timeouts to prevent a runaway
    ///     expectation from hanging the test.
    @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
    @nonobjc public class func fulfillment(of expectations: [XCTestExpectation], timeout seconds: TimeInterval = .infinity, enforceOrder enforceOrderOfFulfillment: Bool = false) async -> XCTWaiter.Result
}

I've also checked Xcode 14.2/iOS 16.2 on an M1 and Intel MacBook Pro, and it keeps saying "Cannot find 'fulfillment' in scope" . Any clue why?

@tmaly1980 this seems like a question better asked on StackOverflow than on a specific issue on GitHub, as it's like to be your project configuration at fault (check your minimum deployment targets).

Thanks, @grynspan :heart:

Always happy to help!

@grynspan saw this was merged into main, what are the chances of it making into 5.9? Kind of needed to do asynchronous testing on Linux

@briancroom is looking into it.

Can we re-open this ticket since it wasn't able to be merged?

If anyone stumbles upon this before Swift 5.10/whatever release this becomes available, here is the extension I use for support on Linux (based on @grynspan's PR).
When this is officially released, you should just be able to remove the extension.
#if os(Linux)
import XCTest

extension XCTestCase {
    /// Wait on an array of expectations for up to the specified timeout, and optionally specify whether they
    /// must be fulfilled in the given order. May return early based on fulfillment of the waited on expectations.
    ///
    /// - Parameter expectations: The expectations to wait on.
    /// - Parameter timeout: The maximum total time duration to wait on all expectations.
    /// - Parameter enforceOrder: Specifies whether the expectations must be fulfilled in the order
    ///   they are specified in the `expectations` Array. Default is false.
    /// - Parameter file: The file name to use in the error message if
    ///   expectations are not fulfilled before the given timeout. Default is the file
    ///   containing the call to this method. It is rare to provide this
    ///   parameter when calling this method.
    /// - Parameter line: The line number to use in the error message if the
    ///   expectations are not fulfilled before the given timeout. Default is the line
    ///   number of the call to this method in the calling file. It is rare to
    ///   provide this parameter when calling this method.
    ///
    /// - SeeAlso: XCTWaiter
    func fulfillment(of expectations: [XCTestExpectation], timeout: TimeInterval, enforceOrder: Bool = false, file: StaticString = #file, line: Int = #line) async {
        return await withCheckedContinuation { continuation in
            // This function operates by blocking a background thread instead of one owned by libdispatch or by the
            // Swift runtime (as used by Swift concurrency.) To ensure we use a thread owned by neither subsystem, use
            // Foundation's Thread.detachNewThread(_:).
            Thread.detachNewThread { [self] in
                wait(for: expectations, timeout: timeout, enforceOrder: enforceOrder)
                continuation.resume()
            }
        }
    }
}
#endif

(It's worth noting that the XCTest framework that ships with Xcode 15 is a bit smarter about how it does asynchronous waits.)

For anyone watching at home: if you're developing for a Darwin-based platform (macOS, iOS, etc.) using the version of XCTest that ships with Xcode 14.3 or later, this API is already available and you don't need the category.


channel with protobuf

I want to send channel in message to server using gRPC, can we have a type to send channel in protobuf message

This is not possible, for a variety of reasons. Protobufs are a cross-platform data serialization format; channels are neither cross-platform nor data.

@neild got it, can we send mutex in message ?

Just shallow copying a mutex breaks the functionality of a mutex. Copying a mutex between computers necessarily breaks the functionality of a mutex.
No, you cannot transfer a mutex.


Prefix commands with plugin name, suffix with action.

I'm finding original commands names not very friendly for autocompleation user like me. Prefixing command with common name and suffixing with action is more autocompleation friendly.

In this PR 3 commands are added. TwoSlasheshQueries[Disable|Enable|Inspect|Remove]. To not introduce any breaking changes, original commands ([Disable|Enable|Inspect|Remove]TwoSlasheshQueries) are still accessible as a fallback.
There is a few white space changes, I've autoformated it with stylua (default config) to standarise formating.

wrong branch


Next Meetup?

Hey folks!
Isn't it about time to do another meetup?
Anything one could help with?
Best
Marco

Unfortunately we could not do the October one as I was in colombia for DEVCon and we found no other host for this month. I will be back for the November one. But more people on the team (especially people that are willing to host) are always welcome. Would love if we get it happen regularly every month again! Please approach us at the next BHNT if you could imagine to be part of the team and maybe host events.


Add a function to create a copy to clipboard input

Here is a hardcoded one that is not quite right yet:
fields:
  - note: |
      Copy and share this link
      <input disabled="true" type="text" value="${ interview_url(i=user_info().filename, style="short", new_session=1) }" id="myInput">

      <button onclick="myFunction()" onmouseout="outFunc()" type="button">
        Copy to clipboard

        </button>

script: |

css: |

@plocket is this up your alley?

Goals: have one function that works for multiple inputs on the same screen.
Get the copy button aligned on the same horizontal plane as the input.
Make the button look more like the Bootstrap buttons

Is this whole thing one unit that will always appear this way? That is, Copy and share this link <input> <button>.
If not, what will be consistent about this? For example, will the 'Share' button always be inline?

I think the "copy" button will always be on the same horizontal plane as the input. Is that what you mean? I think it's just one indivisible unit.

We could add CSS and JS files to be included. the function should generate the input, the tooltip, and the copy button, and allow you to have multiples on the screen.

Provided two branches with two different behaviors.
Does not allow interaction with the input field, but the input field is visible: https://github.com/SuffolkLITLab/docassemble-ALToolbox/compare/16share
Additionally hides input field under button: https://github.com/SuffolkLITLab/docassemble-ALToolbox/compare/16_share_hidden
More work needs to be done to separate concerns and improve some names, so let me know which you prefer.

I think it's better for transparency (and in case someone has trouble interacting with the button) if we show the text that will be copied. So let's keep developing that branch. Thanks! Looking good so far.

Got it. What arguments is the function supposed to accept?

Here is a possible function signature:
(text_to_copy, copy_button_label, popover_click_to_copy_label, popover_copied_label) (i gave them long names as documentation but feel free to use whatever names you like)
i suggest running the text through the word() function like the action_button_html() function does. Although we may end up wanting to use a template to make it translatable, not the word system.
One more thing is that if the input is visible, which I think I prefer, you should be able to manually highlight and copy the text but not alter it.


remove unnecessary steps

do you want really to run up, then press ctrl+c and then up -d? or what is the meaning of this operation?

Hi @lazyants,
Obviously no, I don't want to run docker-compose up and after docker-compose up -d. It's just two different way to make the same thing. But without detached mode, it provides logs into your console.
By the way, docker-compose up also build my containers. So the first line can also been removed.
I need to be more explicit because you right, my README is imprecise.
Kind regards,
Maxence


Adding 2-digit number recognition

I want to add a model that recognises 2 digit handwritten numbers from 0-99.

Please assign this issue to me so that I can start working on it.


Fix: don't pass ref to react-polyglot 'translate' function component

Fixes #2098
translate creates a function component hence the warning.
If the ref is really needed (I'm assuming not at the moment) we can:

Update to latest version of react-redux and use forwardRef:
https://react-redux.js.org/api/connect#options-object

or

Wait for this pr https://github.com/nayaabkhan/react-polyglot/pull/20

It does look like this fell out of use, which would mean the places we're running getWrappedInstance() are also obsolete.

I would normally say we should drop the last two optional args for connect() entirely, but since there's still more clean up for it's proper removal, this is maybe better.

I would normally say we should drop the last two optional args for connect() entirely, but since there's still more clean up for it's proper removal, this is maybe better.

You're right I though about removing the redundant parameters all together, but thought it might have some value in explicitly showing the ref is not needed here.

Hey I am experiencing a similar issue was just curious if this hasn't gotten fixed because only 8 / 13 checks are passing on the review. Let me know, I can help move it along if needed possibly.


Fix volumes

I found the following 2 bugs around volumes and fixed them.

Volumes only mounted in InitContainers are not set in the pod.
Template-local volumes are not used at all.

LGTM. Currently, we are in the process of release the stable RC for v2.3.  let me talk to @alexmt for merge into master


Hovering associated type refs doesn't work

Given
fn main() {
    let _: <Foo as A>::Assoc = <Foo as A>::Assoc::default();
}

trait A {
    type Assoc;
}

struct Foo;
impl A for Foo {
    type Assoc = usize;
}

Hovering over of Assoc in the type ascription in the let binding shows the unit type as it falls back to the type of the function body, hovering over the Assoc in the path expression shows fn default<usize>() -> usize. Both cases should be showing usize instead.
From a quick look at thing we seem to drop generic arguments for paths when resolving them I think which seems wrong?
Side note: noticed this when checking how we handle the snippet from this rust issue https://github.com/rust-lang/rust/issues/79658 (which doesn't show type hints which is probably a different issue)

Is this the same as #5003? Not sure..

It might be? I'll dig a bit around

It's not quite the same though it's related still I think, #8283 fixes #5003 but not this one.


Convert events to ReadableStream ?

Perhaps events() should be a ReadableStream of ServerSentMessages instead of an AsyncIterator.
Practically, the stream could still be used with this syntax:
for await (let event of events(res)) {
  console.log('<<', event.data);
}

The difference would be that a ReadableStream (I think, although am fairly confident) performs better and you have the ability to easily pipe it to some Writer or Transformer stream. For example, imagine:
events(res).pipeThrough(new JSONTransformer).pipeTo(...)

To do the same now, with the AsyncIterator, you have to manually loop the iterable and apply your work; or, convert it to a ReadableStream to be able to do any pipe-work (mentioned above):
// AKA, current implementation
let gen = events(res) as AsyncGenerator<ServerSentMessage, void, unknown>;

// Option 1, where supported
let rs1 = ReadableStream.from(gen);

// Option 2, manual workaround
let rs2 = new ReadableStream({
    async pull(ctrl) {
      let { value, done } = await gen.next();

      if (done) ctrl.close();
      else ctrl.enqueue(value);
    },
  });
}

Considerations

ReadableStreams aren't treated as AsyncIterators everywhere yet; see support. As of now, only Deno >= 1.0, Node >= 16.5.0, and Firefox >= 110 support this feature.

AsyncGenerators (what events() currently returns) is supported in significantly more places.
This may be reason alone to keep what's here.

The ReadableStream.from shortcut is available in Deno >= 1.35, Node >= 20.6.0, and Firefix >= 20.6. However, there's an easy manual workaround when this static method isn't available (see above)

Why async iterator in the first place? Why not EventTarget, like built-in EventSource?

EventTargets aren't composable (like AsyncIterators or ReadableStreams) and so force you to use event-based callback handling, which is fine, but that makes the code/data control flow less obvious. Plus so much of the EventTarget API isn't strictly necessary for parsing or surfacing SSE messages. Most of the code (either mine or polyfill'd) would be to support the EventTarget itself, not the utility.

ReadableStreams aren't treated as AsyncIterators everywhere yet; see support. As of now, only Deno >= 1.0, Node >= 16.5.0, and Firefox >= 110 support this feature.

Until this is true, I don't think it makes sense to make this change. It seems pretty straightforward to convert this into a ReadableStream, so why not provide a helper function to handle the conversion for this instead?
What about the opposite case, how simple is it to convert a ReadableStream into an AsyncIterator where the protocol is not implemented yet?

I manually iterate the async iterator now until completion as of now. Works well & bypasses all the compat issues.
In addresses that #3 issue, I had a ReadableStream branch going and it was a bit more code to set up. Not necessarily a deal breaker, however I do think not being able to for await (let x of events) {...} in common envs is more of a deal breaker


Implement AttachView

@TimLariviere WDYT about merging this to the environment branch. So I can use UseLocalProjectReference with the most up-to-date branch :)


Any sort of todo list for this library?

Hi, I consume this library in a few of my projects and while right now it does quite enough for my uses, I'd like to know if there's any work that needs done with the library.

No, not really. I think I covered most of the base algorithms or at least everything I thought was useful. I know there is additional more advanced stuff from the PCG paper but I'm not really looking into anything like that.
The only small thing I've been thinking of is that I might make Pcg.NextDouble generate from the max 53 bits instead of 32 bits for better quality. I've also started doing some cleanup on my libraries and will probably bump this to 1.0 in the coming weeks anyway despite no major changes.

This makes sense to me, I was surprised by the low version number for something that seemed complete. I’m just using the library for randomness in a few small card/board games though.
Thank you for your work and congrats on a 1.0-worthy library!

Hmm ok feel free to tell me if this is a bad idea, but would you be interested in exposing a GetSeed function of some sort? Or should I just choose seeds some other way? (Such as using a default-seeded instance to generate my seed, then seed using that.)


Use _fsopen vs fopen_s to allow sharing for log aggregators/rotators to access

Added quick change to add_file(...) to windows specific code to allow sharing of the log file so that other programs can read from it.

Will this still work on all Windows compilers, or do we need some compiler switch as well?


Make language-agnostic DocumentWalker

Fixes https://github.com/CodeConnect/SourceBrowser/issues/65#issuecomment-68602618

Make document walker language-agnostic
Move language-specific stuff, like checking what type of token it is or how to get proper name/type for it to IWalkerUtils, which is really simple and should not require any changes when changing DocumentWalker in the future.

I don't know how to test your project, so I didn't. But it's mostly just moving stuff around, so I'm not too much concerned about breaking anything. IWalker interface declaration didn't change.

:+1: It's very well written! It's great to see C# 6 code.
Does WalkerSelector specifiy which implementation of IWalkerUtils to use, and constructor of DocumentWalker is the one that actually creates an instance of IWalkerUtils via walkerUtilsFactoryMethod?

Yes, you're correct.That's because both CSWalkerUtils and VBWalkerUtils need back reference to IWalker to call VisitToken.

Looks good to me.
Thanks for your help @MarcinJuraszek


Update: Filter Updates

Description
Filter Updates
Proposed Changes

Fix Elide filter operator mapping
Fix Elide filter string for in lists
Remove elide adapter parameter support
Convert utils/request-metric to ts
Fix type issues

Screenshots
License
I confirm that this contribution is made under an MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

Is the nbet operator something we want support for in Elide as well?

yes https://github.com/yahoo/navi/issues/1044


Suggestion: Array.prototype.sort - remove the need for compareFn to handle undefined values

Search Terms
Array.prototype.sort undefined, Array.prototype.sort, sort undefined, extends undefined ? never : T, Array prototype sort, Array.prototype
Suggestion
Based on my understanding of the JS spec the Array.prototype.sort compareFunction is never called on undefined values in an array (they are always sorted to the end of the array).

all undefined elements are sorted to the end of the array, with no call to the compareFunction
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort

However, currently the inputs of the compareFn have the type T where T is the types of values in the array. Which forces the developer to make their compare function handle undefined values, despite the compare function never being called with undefined values.
Current
sort(compareFn?: (a: T, b: T) => number

Suggested
sort(compareFn?: (a: T extends undefined ? never : T, b: T extends undefined ? never : T) => number

Use Cases / Examples
The below which is not currently valid would now be valid.
[1, undefined, 2].sort((a: number, b: number) => a - b)

Checklist
My suggestion meets these guidelines:

[x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
[x] This wouldn't change the runtime behavior of existing JavaScript code
[x] This could be implemented without emitting different JS based on the types of the expressions
[x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
[x] This feature would agree with the rest of TypeScript's Design Goals.

Not sure if this is classed as a bug fix or a suggestion, so out of caution I have marked it as a suggestion. If this gets approved as an issue then I will open a PR with a fix!

Making this a conditional type is going to make a lot of things a lot worse in terms of assignability and contextual typing, and honestly this is the first I've ever even heard of this behavior. Doesn't seem like a benefit on net given the current rules around conditional types.

@RyanCavanaugh Forgive my lack of understanding, but could you please explain how this will make assignability and contextual typing worse? I have looked at the documentation for contextual typing and I don’t understand how it would make things worse.
Additionally I have provided a playground to demo the behaviour Playground Link and a more complete example that may help make the benefit more obvious.
Example below errors, but would compile with my proposed change
function compareWordLength(a: string, b: string) {
     return a.length - b.length;
}

console.log(["hi", undefined, "hello", "hey"].sort(compareWordLength))

Example that currently compiles, but requires far more code that is never actually called and only leads to confusion.
/**
* considers undefined words to have lenght 0,
* however because sort() never calls this with undefined values,
* undefined values are always placed at the end of the array
*/
function compareWordLength(a: string | undefined, b: string | undefined) {
   let lengthA, lengthB: number;

   if (a === undefined) {
       console.log("I am never called");
       lengthA = 0;
   } else {
       lengthA = a.length;
   }

   if (b === undefined) {
       console.log("I am never called");
       lengthB = 0;
   } else {
       lengthB = b.length;
   }

   return lengthA - lengthB;
}

console.log(["hi", undefined, "hello"].sort(compareWordLength))

Mmm, maybe it's not as bad as I expected.

I have a branch with a fix ready for a PR once this gets marked as help wanted/added to the backlog

A PR is now open with a fix for this

Hey @RyanCavanaugh is there any chance I could get someone to have a look over this issue and the corresponding pr, for more feedback? ☺


Bug : While storing the bytecode on the chain unable to get the code id.

While trying to store the bytecode of the example contracts such as name-service , cw-to-do-list and other contracts ,
I'm getting an
Error: rpc error: code = InvalidArgument desc = failed to execute message; message index: 0: Error calling the VM: Error during static Wasm validation: Wasm contract requires unsupported import: "env.abort". Required imports: {"env.abort", "env.addr_canonicalize", "env.addr_humanize", "env.addr_validate", "env.db_next", "env.db_read", "env.db_remove", "env.db_scan", "env.db_write", "env.debug", ... 5 more}. Available imports: ["env.db_read", "env.db_write", "env.db_remove", "env.addr_validate", "env.addr_canonicalize", "env.addr_humanize", "env.secp256k1_verify", "env.secp256k1_recover_pubkey", "env.ed25519_verify", "env.ed25519_batch_verify", "env.debug", "env.query_chain", "env.db_scan", "env.db_next"].: create wasm contract failed: invalid request
The command used to store the bytecode is wasmd tx wasm store artifacts/cw_to_do_list.wasm --from main1 $TXFLAG -y -b block
cargo-version: 1.70.0 (ec8a8a0ca 2023-04-25)
rust version:1.70.0 (90c541806 2023-05-31)

The chain is missing env.abort which means it is running a very old version of CosmWasm/wasmvm. It must be even lower than 1.0.0. Which chain are you trying to upload to?

The chain is missing env.abort which means it is running a very old version of CosmWasm/wasmvm. It must be even lower than 1.0.0. Which chain are you trying to upload to?

I'm trying to deploy on wasmd chain locally.

I see. Then you probably use a very old version. You can try a newer one to get more modern wasmvm versions in the dependencies.


Export Id constructors

This allows library users to construct Id types from text. This is
really useful when the id was stored in a database as a string and needs
to be constructed back into it's Id type before using it with this
library.
Solves #54

You are not the first person to ask for this but fwiw it was already possible to constuct IDs by using the getId isomorphism.

@mpickering I'm new to lenses and isos ... could you provide an example to how I could do this?

You can do,
> review getId "abc"
Id "abc"

An Iso is characterised by two functions, s -> a and b -> t. In order to extract the first direction you use view and the second direction you use review.

Oh really cool! thanks!


Fix batch client for optional overload null checks

@xingwu1
I fixed the Base64 usage as well. java.util.Base64 is only available in Java 1.8.

@jianghaolu Looks good to me. Thanks.


logging in without a scratch account

so banned people can join wfc
we will use a password and a username + captcha

i do not want numbers man to haunt wfc
cc @CluckCluckChicken

what xD

you should be able to link to your github account, but you have to first sign up with scratch

I really only want ppl to log in with scratch.

usually when people are banned they are banned for a reason, i think email linking would only be ok if you have to sign up with scratch in the first place

usually when people are banned they are banned for a reason

i was once ip banned for 5 months by accident so i dont really agree.  I think having options for only scratch and github would be ideal.

yeah, maybe just have gh and scratch as options
On Tue, Jul 13, 2021, 10:19 PM CubeyTheCube @.***>
wrote:

usually when people are banned they are banned for a reason
i was once ip banned for 5 months by accident so i dont really agree. I
think having options for only scratch and github would be ideal.
—
You are receiving this because you authored the thread.


Introduce Service Accounts

Describe the problem to be solved
Following up on https://github.com/gristlabs/grist-core/issues/579, @paulfitz @hexaltation @jonathanperret and I sat down to outline a solution to the more granular API keys feature request. Here is what we discussed :
Describe the solution you would like
We offer to introduce the concept of "Service accounts", partly inspired by what GCP is doing
At a high level, a service account is just like a regular user in Grist -- it can be added to any number of documents, workspaces, or orgs. ACL apply to this user and it has its own API key.
Service account lifecycle

Lyfecycle of a Service account follows the same rules as that of a user

The owner of a document can CRUD a Service account and add it to that document (note : technically, the user then becomes a "Guest" in the document's org/team site)
The owner of a workspace can CRUD a Service account at the workspace level
The owner of a team site can CRUD a Service account at the team site level
other roles (EDITOR or VIEWER) cannot CRUD a service account

There should be an admin panel at the team site level where all service accounts in the org can be listed (along with the documents they have access to) and managed centrally by team site owners
The Service account's API Key can only be accessed by the creator of the Service account (important : Owners of the team site should not be able to get the API key of Service accounts via the admin panel)

UI/UX considerations

The creation panel for a Service account could be a separate panel in the "Manage users" menu
There should be a way to describe what the service account will be used for (e.g. "Connect Grist to Mattermost", "Integrate with our marketing ETL pipeline", ...)
The UI should make clear that Service account are robots
The UI should show who created the service account in the first place
The new Service account admin panel should make it easy to provision, audit and delete Service accounts
(maybe) There should be a UI to re-generate a Service account API key (or maybe deleting the Service account and creating a new one would be enough ?)

Technical considerations

Service account key is shown at creation time only. If you need to read it again, you should regenerate it.
There should be a boolean column in the users table to differentiate Service accounts from regular accounts
Service accounts don't necessarily need to have an email address, especially if #759 is implemented. If they do, they could look like<EMAIL_ADDRESS>

Here are the concrete next steps we agreed on :

[ ] have @lusebille provide us with Figma mockups to inform our decision regarding the functionality : https://github.com/gristlabs/grist-core/issues/1218
[ ] have @hexaltation implement a light technical proof-of-concept for Service accounts against the API only : https://github.com/gristlabs/grist-core/issues/1219

Question about regenerating keys. Firstly, creating a new service account + deleting old is not equivalent to regenerating, because the existing account could have been manually added to certain documents, or mentioned in certain access rules.
If we support regenerating the secret key and associating it with the existing service account, should we support a grace period when both keys work? For example, Stripe offers this option. Stripe calls it "Rolling API Key", it's documented here: https://docs.stripe.com/keys#rolling-keys. At the time of regenerating a new key, you get to specify expiration for the previous one, which could be "Now" or after a certain time.
Asking this now, because if we need to support two secret keys for the same service account, this may affect the schema.

Just let you know mocks are links to the ticket #1218 ( style work in progress) but close to the final version

I got a recursive question while implementing the #1219 POC.
Can a service-account CRUD for service-account?
If so, is its owner the CRUDing service account or the owner of the CRUDing service-account?
@dsagal @vviers @paulfitz do you have some opinion on that point?

Can a service-account CRUD for service-account?

I would say no, especially since SCIM (#1199) will provide a nicer way for another app or service to CRUD users progamatically ?
But I haven't thought about it too hard so I am interested in hearing what others think


okcruby food for May Meeting

group: okcruby
food type:  pizza
guest approximation: 15
meeting date: May 12th, 2016 11:30
For visibility,
organizers: @jagthedrummer @piisalie @datachomp

Would be nice to do something non-pizza for a change. We do have some vegetarian members, so we need some veggie options.

Whatever y'all want, just let me know. Don't have time rn for researching good alternatives that include veg options, but I can place the order (or jesse, ryan or vance can) :(

Yeah, sorry, didn't mean to put that on you. I don't really have any other options at the ready. I guess we better just go with pizza since it's well understood. Thanks, @amandaharlin! 😄

Just checking in real quick... did this get ordered so we can close out the issue?

just ordered jimmy johns with 2 veggie sandwiches (which are cut in half). didn't know how many vegetarians there were =/ can one of you pick up some 2 liters of soda on your way there? there's a gas station nearby on sheridan, right off the highway.

Thanks, @amandaharlin! I'll grab some sodas on the way.

perfect! at the new space we'll stock up on soda, water, cups, plates, and napkins so this will just be a thing of the past! 😎 :cool:

❤


Ti SDK 7.0.0.GA Update

Ti SDK 7.0.0.GA Update

[x] removed playservice files
[x] removed proguard folder
[x] added ti.playservice module
[x] tested with Ti SDK 7 + Ti.Maps + Ti.Goosh
[x] send normal push to device (foreground/background)
[x] send push to topic (foreground/background)
[x] updated README to show subscribe to topic (+ php example)

Hey, thank you! :)
Did you test the build?

I've ended up with [ERROR] E/ti.goosh.TiGooshModule: Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference but I thought it was just because I've added the module to an empty project and just used the democode without any GCM ID.
But it would make sense to change the whole library structure to ti.playservice because that is available with ti 7! Going to test that at the weekend and update the PR.
So don't merge yet!

Now everything works fine with ti.playservices! Updated the initial post with all the changes

Awesome. Thanks so much. I am currently blocked from releasing our app due to conflicts with playservices, when do you think we'll have a this new version released?

@amigoni feel free to try it out: https://github.com/m1ga/ti.goosh/blob/7aeaab951699bff0fd837ac416c9e50e416bc304/android/dist/ti.goosh-android-4.0.0.zip

Awesome! Thanks so much! I really appreciate it.


feat(menu): state EventEmitter for Menu

closes https://github.com/driftyco/ionic/issues/5163

hello guys,
I would like to ask about this pull request. When is it going to be merged?
Cheers

Hi @piotrbelina I'm trying to get back to it to fix up a couple things. I'll get it all set and ready this week. Thanks for the ping :+1:

Hi @NathanWalker thanks for quick update. Great to hear. I'm trying to use https://github.com/mapsplugin/cordova-plugin-googlemaps and without menu events it is not possible to get map and menu working well

Nice... yes I want this as well!

@adamdbradley I have added opened/closed events. open/close were already used for the methods so didn't want to cause duplicate identifier issues.
I'm having trouble testing though. I unfortunately don't know the ionic v2 codebase well enough to dig further and my time is limited for trial/error session. You will see 2 different testing strategies in the test here that I'm attempting. One is with the TestComponentBuilder which would be a great way to test this and many of ionic's other components. This requires a beforeEachProviders block likely as it causes this vague error:
MenuController menu events should emit opened FAILED
	TypeError: queueableFn.fn.call is not a function

which is usually related to a provider being needed (not sure which one?)... you guys may know right away.
The other method is similar to your other specs. However this method causes problems because nativeElement is undefined in the Menu:
MenuController menu events should emit opened FAILED
	TypeError: Cannot read property 'nativeElement' of null
	    at Menu.getNativeElement (/Users/nathan/Documents/github/angular2-stuff/ionic/dist/bundles/ionic.system.js:1542:47)
	    at Menu._before (/Users/nathan/Documents/github/angular2-stuff/ionic/dist/bundles/ionic.system.js:13702:34)
	    at Menu.setOpen (/Users/nathan/Documents/github/angular2-stuff/ionic/dist/bundles/ionic.system.js:13640:30)
	    at Menu.open (/Users/nathan/Documents/github/angular2-stuff/ionic/dist/bundles/ionic.system.js:13767:37)
	    at MenuController.open (/Users/nathan/Documents/github/angular2-stuff/ionic/dist/bundles/ionic.system.js:12765:41)
	    at Object.<anonymous> (/Users/nathan/Documents/github/angular2-stuff/ionic/dist/tests/components/menu/menu.spec.js:209:26)

If anyone could give me insight here, I can adjust. I wish I had more time to dig further.
This also adds angular/testing to the runner which will make testing components a lot better I would think.
Additionally it would help to add some more to the CONTRIBUTING doc on how to run the e2e test suite. Looking through the gulpfile.js to figure it out is cumbersome and I don't see it documenting specifically unless I am really missing something.

Hey guys, what's the status on Menu Opened and Closed events?
Need this as well for cordova-googlemaps!
Cheers

+1

I'll pull this back up in another day or 2 and see what I can figure out here, thanks for pinging this.

Sorry for the late response and not merging sooner, but the code diverged enough that it was no longer a clean merge. But the opened/closed events have been added now, thanks.

Awesome to hear, thanks @adamdbradley !


crash when try to read abr from mapgen settings

2020-04-19 09:44:48: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'wildlife' in callback luaentity_Step(): .minetest/mods/mobkit/init.lua:712: attempt to perform arithmetic on upvalue 'abr' (a string value)
2020-04-19 09:44:48: ERROR[Main]: stack traceback:
2020-04-19 09:44:48: ERROR[Main]:       .minetest/mods/mobkit/init.lua:712: in function 'get_closest_entity'
2020-04-19 09:44:48: ERROR[Main]:      .minetest/mods/wildlife/init.lua:201: in function 'logic'
2020-04-19 09:44:48: ERROR[Main]:      .minetest/mods/mobkit/init.lua:957: in function </home/mars/.minetest/mods/mobkit/init.lua:937>

happens on my server using mapgen V6
solution is trivial :)
for example like:
local abr = tonumber(minetest.get_mapgen_setting('active_block_range')) or 1

thanks, looking into

Do you know how it happens by any chance? I fail to reproduce this problem with mv6.

Yes that is a strange issue because it only happens on my server Jungle. I guess it has something to do with the lua version maybe. Someone had a similar issue with my water-life mod:
https://github.com/berengma/water_life/pull/20
That never happened on my other servers or my desktop at home. An other thing that ocured on that server Jungle is a crash after running this:
https://forum.minetest.net/viewtopic.php?p=372100#p372100
Goto command and ::gotohere:: unknown. That is what makes me think that there is a Lua version problem. But maybe I am totally wrong, being only an amateur X)

How it happens is difficult to say. The server is full of mods and 5yrs running now. I deleted mobs_redo and all mobs from it. Installed mobkit, wildlife, petz, aerotest and water_life. Started and server crashed. After adding the "tonumber" it was fixed and runs until today like that :)

Ok then, so I'm not going to know.
Made the change anyway, thanks.

Turns out this is an engine bug.
https://github.com/minetest/minetest/issues/9841

By the way active_block_range is not a mapgen setting, there is no reason to use minetest.get_mapgen_setting().

By the way active_block_range is not a mapgen setting, there is no reason to use minetest.get_mapgen_setting().

I think I had to use it for a reason, I'm going to check again.