Unhandled Exception

Hey.. I can't get Akavache to work with an Xamarin PCL Project (Android Deploy)
protected override void OnInitialized(){
    InitializeComponent();
    BlobCache.ApplicationName = "MyApp";
    startUp();
}

private async void startUp(){
    string startPage;
    try {
        startPage = await BlobCache.UserAccount.GetObject<string>("StartPage");
    } catch (KeyNotFoundException ex) {
        startPage = "StartPage";
    }
    await NavigationService.NavigateAsync(startPage);
}

I just want to get (if exists) the value of StartPage and then navigate the to stored page.
But every time i run the app i get an unhandled exception with no more details. Am i doing anything wrong?

This is because you are calling startup method which is having async. The main thread will call the startup method on a different thread, come back in the OnInitialized method and continue executing. While doing this, it doesn't find any NavigationService instance/call (It doesn't know where to go from here now?), it exits and crashes the application.
Ideal way to have this is - you navigate to the first page and there in the constructor add to cache.

What is the exception? Where's the stacktrace?
PS: async void anywhere in your code base should be considered harmful. Don't do it.
This knowledge is well documented in blogs, pluralsight, talks and at MSDN!
http://haacked.com/archive/2014/11/11/async-void-methods/
There's one one circumstance where it's permitted. Search your codebase today and make amends :)

Application: UniVoting.Client.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileLoadException
at UniVoting.Client.App+d__1.MoveNext()
at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[[System.__Canon, mscorlib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon ByRef)
at UniVoting.Client.App.OnStartup(System.Windows.StartupEventArgs)
at System.Windows.Application.<.ctor>b__1_0(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at System.Windows.Application.Run()
at UniVoting.Client.App.Main()
same error. and i don't event have an async void in my code except for the event handlers

removed Async using blocking calls on all functions at startup
_positions = new List();
		try
		{
			var electionData = ElectionConfigurationService.ConfigureElection(Convert.ToInt32(Settings.Default.ElectionId));
			BlobCache.UserAccount.InsertObject("ElectionSettings", electionData).Wait();
			_positions = ElectionConfigurationService.GetAllPositions();

			BlobCache.UserAccount.InsertObject("ElectionPositions", _positions).Wait();
		}
		catch (Exception exception)
		{
			MessageBox.Show(exception.Message, " Election Settings Error");
		}

still crashing with the above error

`_positions = new List();
try
{
var electionData=ElectionConfigurationService.ConfigureElection(Convert.ToInt32(Settings.Default.ElectionId));
BlobCache.UserAccount.InsertObject("ElectionSettings", electionData).Wait();
_positions = ElectionConfigurationService.GetAllPositions();
BlobCache.UserAccount.InsertObject("ElectionPositions", _positions).Wait();
}
catch (Exception exception)
{
MessageBox.Show(exception.Message, " Election Settings Error");
}`

  BlobCache.Secure.GetObject<User>(AppConstants.UserKey)
                               .Subscribe(x =>
                               {
                                   if (x != null && !string.IsNullOrEmpty(x.session_id))
                                       NavigationService.NavigateAsync("/MainPage/Navigation/UserProfile");
                               },
                               ex => {
                                   NavigationService.NavigateAsync("LoginPage");
                               });

I'm also seeing this crash. What is the right way to check if the user is logged in via akavache and navigate to page accordingly?

@Im-PJ are you sure that the navigation is correct?  Is the view registered for navigation?
Otherwise you can try it with a simpler way:
var x = await BlobCache....
if x != null && ...
just do it like that is a bit easier i guess..
Sorry for the bad formstting im writing thos comment on my phone

@Im-PJ   it looks like you're using Xamarin Forms and Prism? Is that correct?
Some thoughts

You're just calling NavigateAsync but not awaiting the task
Xamarin forms is really pesky when it comes to startup :-(  From my experience you have to do everything synchronously up until you provide a page to Xamarin Forms otherwise it can throw odd exceptions.  I've found it's best to just have a landing page you start with and then work from there. I know that's not ideal but until Xamarin Forms provides some sort of  async way to load that first page there's not great options.
I'm not sure how prism handles this but when you get data back from Akavache you will most likely be on a TaskPool  thread (inside the subscribe or error handler) and not a UI Thread. Can Prism handle Navigation that's instigated off the UI Thread?

If you look here you'll see one way I've tried is to just Wait on the observable
https://github.com/PureWeen/ReactiveUI.XamlForms.Sample/blob/master/ReactiveUI.XamlForms.Sample/App.xaml.cs
I don't really do it that way these days and will probably swap that sample out but it's an example.
Something to keep in mind also is that there's a load penalty to Akavache as well so I've found you can shave off between 1 to 2 seconds not touching Akavache until after that first page loads

@PureWeen  Yes I'm using XF and Prism. You were spot on with 3rd pt.
This worked   Device.BeginInvokeOnMainThread(() => NavigationService.NavigateAsync("LoginPage"));
I will go through your example to learn more about Rx.

Something to keep in mind also is that there's a load penalty to Akavache as well so I've found you can shave off between 1 to 2 seconds not touching Akavache until after that first page loads
I was not aware of this. Still looking for best way to check whether user is logged in, during application startup.

Cool glad that worked
Yea I gave up trying to make it work during application startup :-(  The main barrier I was hitting is that there is a bug in iOS 8 with deep linking that adds about 5 seconds on your startup because of iOS things
https://techcrunch.com/2016/03/28/its-not-just-you-clicking-on-links-in-ios-9-3-can-crash-your-iphone/
So on my test device (iphone4 and ios 8.4) I was just trimming things down as much as I could in order to get deep linking not crashing on an ios 8 device and just getting that first page to load ASAP before loading anything else.
For example I'm using Firebase.  I found that the configure calls added around a second so even for Firebase I just pushed the configure calls to after the first page loads.  Then on my first page load I just have a "we are loading your data" message at which point I will swap out the root page if they are logged in.   I know it sounds lame in cases where they are logged in but I've found that it feels faster for the user to just load a loading page ASAP then load the right page.

Sounds interesting. Just to clarify, I initiliase everything in App.cs in
xamarin forms.
So do you mean to move all initialise code to Page1 and keep app.cs lean?
I also have splashactivity for android.
It would have been easier and encouraging to see some code.
On 14 Jul 2017 10:19 pm, "Shane Neuville"<EMAIL_ADDRESS>wrote:

Cool glad that worked
Yea I gave up trying to make it work during application startup :-( The
main barrier I was hitting is that there is a bug in iOS 8 with deep
linking that adds about 5 seconds on your startup because of iOS things
https://techcrunch.com/2016/03/28/its-not-just-you-
clicking-on-links-in-ios-9-3-can-crash-your-iphone/
So on my test device (iphone4 and ios 8.4) I was just trimming things down
as much as I could in order to get deep linking not crashing on an ios 8
device and just getting that first page to load ASAP before loading
anything else.
For example I'm using Firebase. I found that the configure calls added
around a second so even for Firebase I just pushed the configure calls to
after the first page loads. Then on my first page load I just have a "we
are loading your data" message at which point I will swap out the root page
if they are logged in. I know it sounds lame in cases where they are logged
in but I've found that it feels faster for the user to just load a loading
page ASAP then load the right page.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/akavache/Akavache/issues/343#issuecomment-315408822,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABXrOxRgtYaOVuU0W_vUrqHZd7OrGNqlks5sN5wKgaJpZM4MDI-v
.

Yea that's what I'm currently doing and I have no credible reference to say it's the best way to do it but it's what I've found works for me to get to that first page load quickly. I have a Splash Screen on iOS as well but iOS doesn't care :-) you hit that load time limit and it will just kill the app
My plan is to eventually convert my sample over to something to be proud of but in my current app basically i just do it like this (I'm using ReactiveUI)
I've extracted out what I'm doing and simplified it down a bit here so hopefully this makes sense
public class MyApplicationRootNavigationPage
...
            this.WhenActivated((CompositeDisposable disp) =>
            {
                if (!ApplicationStateService.Current.AppLoaded)
                {
                   BlobCache.ApplicationName = "AppName";
                    ApplicationStateService.Current.AppLoaded = true;

                   //I wait to even instantiate any VMs until the first page is loaded on screen
                    MainPageViewModel viewModel = new MainPageViewModel();
                    BindingContext = viewModel;
                }
            }

Then I just expose that as a BehaviorSubject from ApplicationStateService.Current
 bool _AppLoaded = false;
        BehaviorSubject<bool> _appLoadedSignal = new BehaviorSubject<bool>(false);

        public bool AppLoaded
        {
            get { return _AppLoaded; }
            set { _AppLoaded = value; _appLoadedSignal.OnNext(value);}
        }

        public IObservable<bool> AppLoadedSignal { get { return _appLoadedSignal.AsObservable().DistinctUntilChanged().Where(x=> x).Take(1); } }

Then I just wire stuff to it so in my finishedLaunching on iOS I have
 ApplicationStateService
	                .Current
	                .AppLoadedSignal
	                .ObserveOn(RxApp.TaskpoolScheduler)
	                .Subscribe(
	                _ =>
	                {
						Firebase.Analytics.Options.DefaultInstance.DeepLinkUrlScheme = "SCHEME";
						Firebase.Analytics.App.Configure();
	                });

Basically anything that isn't needed to setup that first page I just delay until that FirstPage is visible

This is still quite a relevant issue, as there's no async way to initialize app. I too want to check if user is logged (by reading data from akavache), before I decide whether to show login screen or home screen.
Is a "second splash screen" still really the way to go?


PHP 7 Segmentation Fault

Hi.
I noticed that if I compile Mosquitto-PHP under a PHP 7.0 environment, some random bugs occur when running example scripts.
When I create a basic subscriber, the php script randomly crash segmentation fault. I used example scripts and tested to fix em without success.
I tested both cases under clean Debian 9 installations.
But under a full PHP5.6 environnement, everything works fine, with libmosquittlo-dev 1.4.3. Mosquitto-php seems not compliant with PHP7.

Hi, i found this segfault too and probably i fixed him in pull request #54
Would be great if you can test it.

I tested your pull request under the same environement, compiled with PHP7 clean install and looks fine !
I don't have anymore problems with segementation fauls :+1:


electron-packager skips or ignores the content of package.json

Preflight Checklist

[x] I have read the contribution documentation for this project.
[x] I agree to follow the code of conduct that this project follows, as appropriate.
[x] I have searched the issue tracker for a bug that matches the one I want to file, without success.

Issue Details

Electron Packager Version:
Electron Packager 15.1.0
Node v10.19.0
Host Operating system: linux 5.4.0-7642-generic (x64)

Electron Version:
v10.1.0

Operating System:
Linux x86_64

Last Known Working Electron Packager version::
Not applicable.

Expected Behavior
Electron packager should not ignore the build options present in package.json.
Actual Behavior
It ignores everything and just operates a raw cp.
To Reproduce
{
    "name": "test-electron-react-ts",
    "version": "1.0.0",
    "description": "Test app",
    "build": {
        "files": [
            {
                "from": "dist/release",
                "to": ".",
                "filter": ["**/*"]
            }
        ]
    },
    "main": "main.js",
    "scripts": {
        "build:dev": "webpack --config ./webpack/main.config.js",
        "build": "webpack --config ./webpack/package.config.js",
        "internal:wp": "webpack-dev-server --config ./webpack/react.config.js",
        "internal:electron": "electron dist/debug/main.js",
        "start:dev": "parallelshell -k \"npm run internal:wp\" \"npm run internal:electron\"",
        "start": "npm run build:dev && npm run start:dev",
        "lint": "eslint src webpack"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "devDependencies": {
        "@types/react": "^16.9.48",
        "@types/react-dom": "^16.9.8",
        "@typescript-eslint/eslint-plugin": "^3.10.1",
        "@typescript-eslint/parser": "^3.10.1",
        "css-loader": "^4.2.2",
        "electron": "^10.1.0",
        "electron-packager": "^15.1.0",
        "eslint": "^7.7.0",
        "eslint-plugin-react": "^7.20.6",
        "file-loader": "^6.0.0",
        "html-webpack-plugin": "^4.3.0",
        "parallelshell": "git+https://github.com/Yuri6037/parallelshell.git",
        "react": "^16.13.1",
        "react-dom": "^16.13.1",
        "style-loader": "^1.2.1",
        "ts-loader": "^8.0.3",
        "typescript": "^4.0.2",
        "webpack": "^4.44.1",
        "webpack-cli": "^3.3.12",
        "webpack-dev-server": "^3.11.0"
    },
    "dependencies": {}
}

Additional Information

When replacing electron-packager with electron-builder and building linux AppImage it works

The build key in your package.json is a non-standard field. Electron Packager is configured using either the JavaScript API or command line flags. If you would like to use Electron Packager with configuration embedded in package.json, take a look at Electron Forge, which uses Electron Packager internally.


CRYSTAL_ENV

Kemal has KEMAL_ENV, Amber AMBER_ENV, and other code will have their own way of describing test, dev, production.
It'd be good to agree on this and the language should perhaps take the lead. Hence opening the issue here. Other shards would be able to tap into this to modify their behaviour.
This doesn't need any change to crystal, just perhaps a docs update.

I propose:

Use CRYSTAL_ENV as environment variable
production, development and test as recognized values
Add ENV.production?, ENV.development? and ENV.test? as test getters so that everyone can easily access it

This would practically enforce a standard, and ensure that random shards don't depend on checking ENV["KEMAL_ENV"]. Let's not have another Railstie thing.

The notion of requiring an environment variable to put code into "production mode" is fine when your code is running on a server you control, but it is not a viable paradigm outside of the web world and perhaps a few other places. Crystal does provide some facilities for web work, but is not a purpose built web language like the two frameworks @crisward cited. What would this mean if I was programming a system utility? A video game? Is hanging code or community paradigms off of
The namespace feels weird. To me, an environment variable like CRYSTAL_ feels like it should be configuring crystal itself during a compile rather than a runtime as in JAVA_HOME and GO_PATH. As an aside, I'm very glad Crystal doesn't have a CRYSTAL_UNIVERSE or somesuch.
I understand the fear of the Railstie paradigm, but that feels like a community intent that a community might not have much control over. After all, a big lament in the ruby community is that it's "only used in Rails". Rails just happens to be the framework that landed, stuck, and got used enough to create that inertia. Moreover, I'm not sure how a community standard environment variable is going to prevent Amberties from materializing.
As @Papierkorb mentioned, KEMAL_ENV, AMBER_ENV, UPPERCASE_ENV etc are all kind of brutal to deal with, but it seems like a well designed library shouldn't need to be asking those sort of questions in the first place. Configuration allows those boundaries to be cut cleaner.
🍎

What would this mean if I was programming a system utility? A video game? Is hanging code or community paradigms off of

This would be useful for everything that wants to distinguish environments.  Which is everything where you talk to external systems, may that be an REST API or a DB.  And this can also be useful for desktop applications (Disclaimer: I develop Qt5 bindings, and I can see a use-case).
And every other program where this doesn't make sense for, 10 more lines in ENV won't change things :)

I love this idea and I love that ENV would have methods for querying against it so you don't need to do string comparison or worry about typos. This is basically what I did in Lucky as well: https://github.com/luckyframework/cli/blob/master/src/web_app_skeleton/config/env.cr
I also like the CRYSTAL_ENV name. It's what I would expect it to be.
I also think your warning is spot on. It should be used for initial configuration. Right now I'm using Habitat for configuration. I'd love it if something like this existed in Crystal itself so there is just one way of configuration Crystal projects. Similar to what Elixir has with mix and MIX_ENV, but maybe that can be added later or handled by an external lib (like Habitat)
@robacarp I think this is useful outside of web projects. Knowing whether something is running in test and configuring the application differently is really important for a number of projects. For example, I'm starting on a library for sending emails. In test, I want to use a TestAdapter that doesn't actually send emails for most of the specs. But in dev/production I'd probably use a real adapter. I think that's pretty handy
MyMailer.configure do
  if ENV.test?
    settings.adapter = TestAdapter
  else
    settings.adapter = RealAdapter
  end
end

Isn't this something that could be developed as a shard and then added to stdlib if it turns out to be commonly used?
There are also other things to consider:
Should it only enumerate a set of environments, or allow people to define their own? I have never worked on a big rails app that was limited to test/dev/production - all major ones have had other defined environments.
Should this only be used to enumerate environments, or should it go the full way and provide a tool to provide environent dependent variables, like dotenv?

Sorry, I didn't mean to say that toggling between program paradigms doesn't have a place outside internet domain programs, but that it often works differently. In web applications, the default environment is often development, while on desktop applications the default is going to be production.

Isn't this something that could be developed as a shard and then added to stdlib if it turns out to be commonly used?

The issue with outsourcing is that control is lost. I have seen too many new languages where the solution is to outsource into there packages and them issue arise when those packages do not get maintained.
A other issue: People use the Shard version, later it get added to stdlib and then you have two versions in the wild ( assuming that for compatibility the syntax stays the same ). Lets say the stdlib version gets more or less features. Some unsuspecting person new to Crystal reads something and then complains that the option does not work because they use the wrong one.
Critical components like DB drivers, Env options, all belong into a main branch of a programming language.

@Papierkorb, Something else occurred to me last night about this statement:

And every other program where this doesn't make sense for, 10 more lines in ENV won't change things :)

While I agree, it's not a pattern that scales. I imagine that there are 10 lines of code for N problem domains that could be incorporated into the crystal core, be they into ENV or elsewhere. This creates the same "railties problem", doesn't it?
That said, one concession does not necessarily a bad pattern make.

I agree with the proposal of this issue. This is all about a convention of having some environment variable that all Crystal apps can use to determine mode of execution.
I'm fine with using the name CRYSTAL_ENV for this. We can then use "development", "test" and "production", or any other value for that matter. But "development" will be the default one (Maybe Crystal should set it at the start of each program unless it's set), "test" should be set by test frameworks, and production is set when explicitly setting CRYSTAL_ENV=production. We could use --release for this, but I'm not sure it's a good idea.
We could actually use shorter names like in Elixir's Mix: http://elixir-lang.github.io/getting-started/mix-otp/introduction-to-mix.html#environments . Maybe that's easier to write comparisons. Alternatively we could have Crystal.env and Crystal.env= as something that provides access to that, I wouldn't touch the ENV module for this.

I love the idea of Crystal.env instead of adding it to ENV. I like that it's easier to spot typos with the shorter names in Elixir, so maybe it's worth using short ones. I'm also ok with the long form version. I also like the idea of returning development if it's not explicitly set.
I think that crystal spec should automatically set the env to test though. I think that's what Elixir's Mix does and it seems to work well. Or maybe I am just missing something. What was your reasoning behind leaving it up to the test frameworks?

I mean that when you do require "spec", spec.cr inside the standard library sets the ENV variable. We can also make crystal spec do that, but you can run spec files without doing crystal spec, just doing crystal spec/some_file.cr works.
I guess we could also have Crystal.dev_env?, Crystal.test_env? and Crystal.prod_env? for these common environments, providing a bit of type safety (or the longer development_env?, but I have no real preference here).

@asterite Ah I see what you mean. Yeah maybe setting it when you require "spec is the best idea since like you said, you can run it with crystal directly. Seems that is a safer approach
As for the type safe env query methods I think it might be shorter/easier to remember as:
Crystal.env.test?
Crystal.env.dev?
Crystal.env.prod?
Crystal.env.name # Returns the bare string

However this is a minor suggestion. What you have also work well I think :)

I like that too. It might be a bit confusing that Crystal.env == "custom" won't work, though, but we can always override the == for that object, and maybe also override it for String so that "custom" == Crystal.env still works... hmm...

That sounds like a pretty slick idea to me :)

Overloading String#== for some random data type is doing more bad than good. If people want to create custom environments, they could just access the proposed #name : String.

Maybe one way to handle it so that we don't overload == and people don't get confused is to raise a helpful compile time error if you try to compare it to a String
class CrystalEnv # or whatever it will be called
  def ==(other : String)
    {% raise <<-ERROR
    Can't compare env to a String. Instead call Crystal.env.name

    Example: Crystal.env.name == "my_custom_env"
    ERROR %}
  end
end

@paulcsmith This CrystalEnv#==(String) is totally fine, I think. The issue is a special overload String#==(CrystalEnv).

Ah. I should've read more carefully! Thanks for the clarification @straight-shoota

I don't know what the precedent for using or not using method-missing in std lib, but this would accomplish the same thing without locking in to a standard set of environments?
class CrystalEnv
  macro method_missing(call)
    name = "{{ call.name }}"
    if name.ends_with?('?')
      ENV["CRYSTAL_ENV"] == name[0...-1]
    else
      # I don't actually know what to do here, but I don't think this works
      super
    end
  end
end

It doesn't matter much, but I'd prefer the full name to the abbreviated names like elixir.

@robacarp I think that could work, but then you don't get the safety you'd get with hard coded method names.
For example, with method_missing you could do CrystalEnv.devlopment? and it would compile, but wouldn't work as you expected (unless you have an env called devlopment :P).
I think instead if you wanted to add your own custom environments you could open up the class and add a method to it, or maybe there could be a macro for registering new environments. But that would probably be best to figure out later

In general we avoid method_missing at all cost.

I don't see the point to have a compiler environment variable. There is flag?(:release) which means something, but CRYSTAL_ENV...? It may make sense in specific frameworks that can have different environments (thought this is debatable) but... at the compiler?
IMHO this is a great idea for an env shard, with more capabilities such as populate ENV from .env or config/development.yml or different kind of files.

@ysbaddaden Maybe the name CRYSTAL_ENV is confusing, but it's definitely not a compiler environment variable. It's similar to MIX_ENV in Elixir, RAILS_ENV in Rails, etc. Just an environment variable that tells you what "mode" an app is running. Here we are just defining a convention for all Crystal apps, instead of coming up with names like KEMAL_ENV, AMBER_ENV, etc. (which actually already exist, at least for kemal).

What about Runtime.environment rather than Crystal.env, since then it's more obvious what it relates to then?
Personally, I'd prefer using whole words for the environments: development, test, production.
But if the environment names have to be abbreviated, rather than copying what Elixir did I'd suggest making the abbreviations consistently 3 characters long for better vertical rhythm: dev, tst, prd.

@asterite For Ruby it's RUBY_ENV - RAILS_ENV is application-specific. That's what we want to avoid 😉 And somewhere in between is RACK_ENV...

APP_ENV?

I like the class approach ['CrystalEnv' or whatever it ends up being called] for a common base; and, then people can sub-class, include, or monkey patch it as applicable for their needs.
Maybe 'CrystalEnv' [or 'Runtime' or 'AppConfig'?] could look something like
AppConfig
  .environment
    :type
    :id
  .instance
    :type
    :id

The 'AppConfig.environment' and 'AppConfig.instance' objects might be a Hash or Json so people can customize/extend as needed.
I think this would be simple and customizable enough to work for simple use-cases, as well as multi-instance servers or multi-user game clients.
For example, you could end up with something like:
AppConfig
  .environment
    :type            == 'prod'
    :id              == 'USA cluster 1'
    :custom_env_key1 == 'my custom value 1'
    :custom_env_key2 == 'my custom value 2'
  .instance
    :type            == 'remote_client'
    :id              == 'user123'
    :custom_inst_key == 'my custom value'

There is no RUBY_ENV, but RACK_ENV. By the way, RACK_ENV doesn't do much, if anything —RAILS_ENV does more, and is actually useful.
I believe CRYSTAL_ENV is confusing. Using Runtime is even more confusing, since it could be understood as "the crystal runtime is in development"... what?
Anyway, this is my last reaction: I believe it would be a great shard, that should be discussed by the different frameworks that use an environment, what they use it for, and how it could be accepted to have a convention over it. Otherwise we'll probably have CRYSTAL_ENV=KEMAL_ENV, just like Rails assigns RACK_ENV=RAILS_ENV.

/shameless plug/ but here you go: crystal-environment

Honestly, I'd really hate having to add such dependency with really just a grain of code providing Crystal.env. Please, let's avoid having such a fragmentation of countless microscopic components like in the node.js ecosystem.

@straight-shoota same here. I'll be happy to make a PR to stdlib, @ysbaddaden u ok with it?

@ysbaddaden hello?

I still believe this is confusing and would prefer a Shard with larger scope (i.e. reading variables from different files and formats), or just each project to have their own solution.
Did somebody from Amber, Kemal or another project said they'd use it? Looks like a "no" to me.

I would definitely use this on Lucky. Right now it's LUCKY_ENV, but I would prefer not to get into the situation in Ruby where there is RAILS_ENV and RACK_ENV that should always be the same because they're used in the exact same way.
I think it would be nice to have one way to set the environment, like how Elixir has Mix.env that all libraries can use to see what environment Elixir is running in.

I think I would prefer this to be a separate shard also. Any integration with specs or changes with release mode compilation can be handled even on separate shards.
Other than including the library in the projects spec_helper and in the entry point to set the defaults I see no other needed boilerplate for the user. And this can be done by the the web frameworks when expanding. Maybe the crystal init could also join that idea, but that is another topic.
If the crystal init will use that the shard would need to live in the crystal-lang organization. But, is that also a requirement for the frameworks to agree on a common environment/stage detection?

I think an external shard that on the crystal-lang org would also work well. I think the key is just that there is one "official" way to set/get the environment. I think we could standardize on dev/test/prod or development/test/production. I think those three are the most common. I personally have a slight preference for the shorthand version, but I think it's fine either way.
And I agree that the tiny boilerplate needed to set the env in spec_helper is not a big deal at all. As long as we have a consistent way to get/set the env it should be fine

@bcardiff external shard under crystal-lang org + adding minimal boilerplate to crystal init sounds gr8 to me, as such solution would cover all of the needs and fears expressed in this issue, without the risks of depending on 3rd party shards.
Let's have One-Way-to-Do-It ™

A shard please, this is way too opinionated and non-universal for the stdlib.

What do you think if we start with something like https://gist.github.com/bcardiff/129962b01266dccfa2fc5ee8ba2ea042 ?
The public api is minimum at support default env for specs via requirements. @Sija is almost the api you propose in https://github.com/Sija/crystal-environment . It seems we were both coding at the same time 😅 , yet I haven't push the code to github.

The tiniest of nits, I'd prefer just crystal-lang/env for the git repo, duplicate crystal- prefixes is fairly useless.

@RX14 , well you access it via Crystal.env. But, yes there are some inconsistencies with the require "env". I don't like require "crystal-env". So, maybe we shoud use crystal-lang/env. In the cases of db/sqlite3/mysql I use prefix because otherwise is a bit unclear from the url if it is a shard or a fork.

@bcardiff Public API is essentially the same, one difference being Crystal::Environment.setup macro which allows you to extend default set of environments (requested by @veelenga in https://github.com/crystal-lang/crystal/pull/5261#discussion_r149726228), which I find pretty useful for non-standard scenarios.

On an api related issue, I prefer to not expose the name. and just use the development?, etc. methods. If we just use that api we could support: dev, devel, development, prod, production, test, spec as values of the environment variable and allow people to setup with short/long names, but have a single way to check.
A getter that will return :development, for dev, devel, development values, could be added for sure.
There is tension between supporting aliases and allowing custom environment names.

So maybe drop .name and have .setup(envs) variant where, envs would be a HashLiteral/NamedTupleLiteral with alias as key, and env as value.
sth along the lines of:
# for aliases
Crystal::Environment.setup({dev: "development"})

# for extending
Crystal::Environment.setup(%w(integration))

If we free the list of possible environments, who is responsible for defining it? the framework or the app? if it is the app, inner shard won't be able to rely on any set of know environment. If it is the framework, then some shards might turn framework dependent. (yet, shards should have a more fine grained config that environment)
That's why I am more in favor of a fixed set of environments and allowing to change just which is the default.

Please keep this simple: dev, test, prod only.

We've agreed this should be in a shard, closing.

I've just published a WIP at https://github.com/crystal-lang/crystal-env . Let's see how the story evolves there.


How to save user settings ?

Options:

Browser Localstorage
Frontend side file modification (via web server)
Database Sidecar
Docker configuration via docker-compose environment variables

Browser Localstorage option

is already implemented


HIP 92: Move datasets into HIP repository

Since we don't want to depend on external links that can be updated, I've moved the linked documents into the HIP repository for now. In the future we could also use other immutable or easy to trace storage like ipfs links.
cc: @capjbadger007 @leogaggl
Let me know if this is an acceptable change.

Making this part of the actual repo rather than external Google Drive is a good idea.
Thanks - all good with that change.


Instantiate request restarts oned service

Description
ONE service is restarted when instantiate a template and send empty schedule actions using XML API
To Reproduce

Create a vm template with the following content:

CONTEXT=[
  NETWORK="YES",
  SSH_PUBLIC_KEY="$USER[SSH_PUBLIC_KEY]" ]
CPU="1"
DISK=[
  FORMAT="qcow2",
  FS="ext2",
  SIZE="128",
  TYPE="fs" ]
DISK=[
  IMAGE="image01",
  IMAGE_UNAME="oneadmin" ]
GRAPHICS=[
  LISTEN="<IP_ADDRESS>",
  TYPE="VNC" ]
HYPERVISOR="dummy"
MEMORY="128"
NIC=[
  NETWORK="vnet5",
  NETWORK_UID="0",
  NETWORK_UNAME="oneadmin" ]
NIC=[
  NETWORK="vnet4",
  NETWORK_UID="0",
  NETWORK_UNAME="oneadmin" ]
SCHED_ACTION=[
  ACTION="hold",
  TIME="1714730400" ]

Instantiate the template using the instantiate operation though the XML API:

curl --location 'http://<IP_ADDRESS>:2633/RPC2' \
--header 'accept: text/xml' \
--header 'accept-charset: UTF8' \
--header 'connection: Keep-Alive' \
--header 'Content-Type: text/xml' \
--header 'User-Agent: NodeJS XML-RPC Client' \
--data '<?xml version="1.0"?><methodCall><methodName>one.template.instantiate</methodName><params><param><value><string>serveradmin:oneadmin:cFN/HHkIP9ZNdw/QwA13btcze3aXDA/JIWuxU8OuRN8=</string></value></param><param><value><int>6</int></value></param><param><value><string/></value></param><param><value><boolean>0</boolean></value></param><param><value><string><![CDATA[<ROOT><CPU>1</CPU><HYPERVISOR>dummy</HYPERVISOR><MEMORY>128</MEMORY><CONTEXT><NETWORK>YES</NETWORK><SSH_PUBLIC_KEY>$USER[SSH_PUBLIC_KEY]</SSH_PUBLIC_KEY></CONTEXT><GRAPHICS><LISTEN><IP_ADDRESS></LISTEN><TYPE>VNC</TYPE></GRAPHICS><SCHED_REQUIREMENTS>(HYPERVISOR=dummy)</SCHED_REQUIREMENTS><OS><BOOT></BOOT></OS><NIC>![CDATA[]]</NIC><DISK>![CDATA[]]</DISK><SCHED_ACTION>![CDATA[]]</SCHED_ACTION></ROOT>]]></string></value></param><param><value><boolean>0</boolean></value></param></params></methodCall>'

<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
  <CPU>1</CPU>
  <HYPERVISOR>dummy</HYPERVISOR>
  <MEMORY>128</MEMORY>
  <CONTEXT>
    <NETWORK>YES</NETWORK>
    <SSH_PUBLIC_KEY>$USER[SSH_PUBLIC_KEY]</SSH_PUBLIC_KEY>
  </CONTEXT>
  <GRAPHICS>
    <LISTEN><IP_ADDRESS></LISTEN>
    <TYPE>VNC</TYPE>
  </GRAPHICS>
  <SCHED_REQUIREMENTS>(HYPERVISOR=dummy)</SCHED_REQUIREMENTS>
  <OS>
    <BOOT/>
  </OS>
  <NIC>![CDATA[]]</NIC>
  <DISK>![CDATA[]]</DISK>
  <SCHED_ACTION>![CDATA[]]</SCHED_ACTION>
</ROOT>

As result of this request, the oned service is restarted. After the restart, the vm is instantiated without schedule actions, so the behavior is right, except for the restart of the service.

Expected behavior
That the service is not restarted when the request is sent to the API and the virtual machine is instantiated without disks, nics and schedule actions.
Details

Affected Component: Core
Hypervisor: N/A
Version: 6.8

Additional context
NIC and DISK attributes:
<NIC>![CDATA[]]</NIC>
<DISK>![CDATA[]]</DISK>

work fine, the problem is only with:
<SCHED_ACTION>![CDATA[]]</SCHED_ACTION>
After solve this problem on the core, we need to uncomment the code in Fireedge Sunstone to send the attribute with CDATA value (src/client/utils/parser/vmTemplateFilter.js):

Progress Status

[ ] Code committed
[ ] Fireedge Sunstone Code committed
[ ] Testing - QA
[ ] Documentation (Release notes - resolved issues, compatibility, known issues)

It was crashing because the the SCHED_ACTION is expected to be a Vector of values, but vmTemplateFilter.js assigns a single value ![CDATA[]].
This may cause troubles also for other Vector attributes like PCI, OS, ...
Fixed casting in the Template::Remove method should solve all similar cases, silently ignoring malformed attribute value.


New Project Added

Description

I just added a new Project.
Screenshots

Related Issue

Checklist
Please review and check off the following items before submitting your PR:

[x] I have tested my changes to ensure they work as expected
[x] I have included documentation for any new features or changes
[x] I have formatted my code according to the project's style guidelines
[x] I have written tests for any new features or changes
[ ] I have run the project's test suite and verified that all tests pass
[ ] I have updated the README and any other relevant documentation
[x] I have checked for any spelling or grammatical errors

Additional Information

As a suggestion, we can add a preview link about the related project on the cards. What do you think? @priyankarpal

Like in this screenshot, the icons are github link and preview link related to the project. @priyankarpal

As a suggestion, we can add a preview link about the related project on the cards. What do you think? @priyankarpal

yeah sure we can add these features. Just need to add a new card design. In that card, if we add extra code. It will look boring.


MIVisionX Setup - Half.hpp

Use half.hpp from official file source
wget https://sourceforge.net/projects/half/files/half/1.12.0/half-1.12.0.zip
unzip half-1.12.0.zip -d half-files
sudo cp half-files/include/half.hpp /usr/local/include/

Fixed in Setup


Dribbblish v2 UI issue when listening on another device

Screenshots

Problem
As you can see, when I use another desktop to listen, the timeline across the song cover.
Specifics (please complete the following information):

OS: win 21H1
Spotify version <IP_ADDRESS>3.gdac868ed-a
Spicetify version 2.5.0
Dribbblish

yep i've been having the same problem too

same problem here

Same thing is happening in JulienMaille/dribbblish-dynamic-theme#16

has to do with the absolute positioning in user.css
.playback-bar {
    position: absolute;
    width: var(--main-view-width);
    left: var(--sidebar-width);
    bottom: calc(var(--main-gap) + var(--bar-height) - 12px / 2);
}

@JulienMaille 👍

you can add this to user.css as a temporary fix:
.main-nowPlayingBar-container>div:first-child:nth-last-child(2) .playback-bar {
    bottom: calc(var(--main-gap) + var(--bar-height) + 18px);
}

Check if https://github.com/morpheusthewhite/spicetify-themes/commit/7b2a5eb5b22c66210e00c32c59499ff3429717f0 fixes it

Check if 7b2a5eb fixes it

@morpheusthewhite nope

Did you go through the installation process again?

uninstall -> install. not okay
become "base" color_scheme

It should have been fixed.
Today, I start my PC, it works okay, but when I rerun spicetify apply, it becomes before.
Then, I try on another PC (it did not use spicetify), I install it and see, it okay. BUT, rerun spicetify apply, becomes bad.
Very strange.......


Plugin not working on large repos

I'm currently not seeing the plugin work on large repos, even when opening one forc project from a large repo separately in it's own window. I've left some steps to recreate what I'm seeing below.
1 - Plugin not working within a repo containing several different Forc projects
Steps to recreate

Clone sway-applications repo
Open sway-applications/AMM/project/contracts/AMM-contract/src/main.sw
Remove a character from the word require shown below:

No red underline appears

2 - Plugin not working when within a forc project from within a repo containing several different Forc projects
Steps to recreate

Clone sway-applications repo
Change directory to sway-applications/AMM/project and open this directory in a new window:

cd sway-applications/AMM/project && code .

In the new window open project/contracts/AMM-contract/src/main.sw
Remove a character from the word require shown below:

No red underline appears

When I run forc build on this example project, I get

Also wasn't able to repro this any more. Seems like the recent parser recovery fixes in the compiler has resolved this. @K1-R1 I'm closing this, feel free to re-open it if you think the issue is still there.


Mention portal-based control method

This page says the change has to be made through Graph, however there is an option in the UI

https://entra.microsoft.com/#view/Microsoft_AAD_IAM/AuthenticationMethodsMenuBlade/~/AdminAuthMethods
Select "Microsoft Authenticator"
Select Configure
Select desired values for "Microsoft Authenticator on companion applications"

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

ID: 02a21275-1d7a-8ddf-6cb3-14f5352c79bb
Version Independent ID: 329dd91b-f4a3-7bd5-61ad-6f6de1a7a025
Content: How to enable Microsoft Authenticator Lite for Outlook mobile (preview) - Microsoft Entra
Content Source: articles/active-directory/authentication/how-to-mfa-authenticator-lite.md
Service: active-directory
Sub-service: authentication
GitHub Login: @sabina-smith
Microsoft Alias: justinha

@Mike-Crowley
Thanks for your feedback! We will investigate and update as appropriate.

Changes have been made to add the UI method into the docs. Thanks!

#please-close


vcpkg_copy_tools() doesn't support macOS .app bundles

Describe the bug
Some of the ports I work with generate a complete .app bundle for some of their tools on macOS. vcpkg_copy_tools() unfortunately fails to detect it and copy to a location.
Environment

OS: macOS

To Reproduce
Steps to reproduce the behavior:

Checkout #20207
./vcpkg install libalkimia[tools] on macOS

CMake Error at scripts/cmake/vcpkg_copy_tools.cmake:62 (message):
  Couldn't find tool "onlinequoteseditor5":

      "/Users/cromo/Documents/Sourcecode/vcpkg/packages/libalkimia_arm64-osx/bin/onlinequoteseditor5" does not exist

Expected behavior
Bundle directory should be treated as an executable and copied as if it was a regular ELF or Windows .exe.

Duplicate of #15164

Please track #15164.


Return by reference in parser functions to prevent copies

VCAnalyse is complaining as parser functions (.delimiter etc) are causing large stack allocations (131k, VCAnalyse limit is 16k)
This is due to the functions returning a needless copy of the parser object, not a reference.
Swapping to reference solves this.

@sebkajeka thank you so much! I added you as a collaborator to the project so you can merge these yourself in the future 😄


WIP: Abolish Z_OOPS()

Work-in-progress patch to eliminate Z_OOPS() usage and have system calls always propagate return values.
See #17735

Putting this up mostly to illustrate some thorny issues discussed in #17735


Add plugin_type argument to meltano install

Migrated from GitLab: https://gitlab.com/meltano/meltano/-/issues/1937
Originally created by @DouweM on 2020-04-02 17:29:46

View 2 previous comments from the original issue on GitLab


Create BinarySearch

I have added the code for binary search in Java language.

You can follow me on github


neonvm-controller: refactor doReconcile

Best viewed by-commit.
Will be merged with rebase.
Part of the #733.

@Omrigan before merging, can you rename the commits to append the PR number?

@Omrigan if you're going to rebase-and-merge, could you rename the commits to append the PR number?

Right, totally forgot! I guess it is 3 strikes to automate it, first take is at https://github.com/neondatabase/autoscaling/pull/1152/files.


Replace example.png with vector graphic.

I noticed an outdated test description in the example.png graphic that appears in the README and docs: "is PureScript 0.12.x compatible". Rather than trying to take a new screenshot, I decided to reproduce the graphic in SVG form so that the text can be more easily updated in the future.

Did you try running make example.png? It requires some dependencies being installed, but has the benefit of being in sync with the code in the example/ directory.

Oh, much better. That was an unfortunate oversight on my part!

No worries, glad it worked!


Empty content for GetStudentEvents and SearchEvents requests

Well, the search events and getting events for student only returns events with state Published and all events in db are already Archived. Maybe I should also make it possible to browse archived events? Or just allow archived and sort the results so that archived will be always last?

Thanks for clarification, I think it would be nice if archived events were allowed to browse, then at frontend side we would have some checkbox to manage if someone want to see all events or only current ones. And then archived events should be always presented last.

Ok, so i will add state option to request body and by default it will get both published and archived events sorted accordingly (the many arguments sort seems to be working fine). Then if state field will not be empty it will give only events of given state (except toBePublished).

Should be working now

It works nice, thank you @eggwhat!


[PE-D][Tester C] History 1 Command does not Work

When entering the command history 1, it lists all students

Labels: type.FunctionalityBug severity.High
original: theman-oj10/ped#1

See #128


Update security-overview.md

Adding 5 new service tags

CognitiveServicesManagement
Dynamics365ForMarketingEmail
AzurePlatformDNS
AzurePlatformIMDS
AzurePlatformLKM

@jispar : Thanks for your contribution! The author(s) have been notified to review your proposed change.


Project local settings

nvim --version: NVIM v0.5.0-752-g759a05407
nvim-lsp version(commit hash): 60133c47e0fd82556d7ca092546ebfa8d047466e
:checkhealth

health#nvim_lsp#check
========================================================================
## Checking language server protocol configuration
  - INFO: pyls_ms: configuration checked.
  - INFO: ccls: configuration checked.
  - INFO: sumneko_lua: configuration checked.
  - INFO: vimls: configuration checked.
  - INFO: rust_analyzer: configuration checked.
  - INFO: texlab: configuration checked.

What language server(If the problem is related to a specific language server): rust_analyzer
Operating system/version: Arch Linux
Terminal name/version: alacritty
$TERM: tmux-256color

How to reproduce the problem from neovim startup
I'm trying to setup up project local settings for my lsp, specifically rust_analyser.
Project local settings are easy for other lsp's. Coc for example allows to create a vim/coc-settings.json similar to vscode's vscode/settings.json, which overwrites the global lsp configuration.
I am using localvimrc to load a directory specific vim files automatically.
But I'm stuck on that point.
My latest approach looks something like this:
lua << EOF
require('nvim_lsp').rust_analyzer.setup {
    on_init = client.workspace_did_change_configuration({
        settings = {
            ["rust-analyzer"] = {
                ["checkOnSave"] = {
                    ["enabled"] = true,
                    ["command"] = "clippy",
                },
                ["cargo"] = {
                    ["target"] = "thumbv7em-none-eabihf",
                },
            },
        }
    })
}
EOF

But this is obviously not working.
I tried the  client.workspace_did_change_configuration({setup}) approach. But I don't really understand, how to apply it.
https://github.com/neovim/nvim-lspconfig/blame/6ebd50abb40e8849ae0717328f478ee75cb62568/README.md#L169
Actual behavior
lua print(vim.inspect(vim.lsp.buf_get_clients())) show the configuration from above under config.settings
Expected behavior
Local settings are not getting applied.
localvimrc: error when sourcing script: "Vim(lua):E5108: Error executing lua [string ":lua"]:2: attempt to index global 'client' (a nil value)" (<...>/.lvimrc, line 20)

on_init = client.workspace_did_change_configuration({ it doesn't know client. That recommandation is for a dynamic setup but in your case you can setup the server before starting neovim so just try to configure rust_analyzer.setup without any trick.
NB: in case you dont know there is :h exrc that can potentially replace  your plugin.

Thanks for your help.
My try above was just a shot in the blue. But your solution is pretty obvious in hindsight :sweat_smile:
thanks for the suggestinos about :h exrc. Seems like the beter solution for my use case, and it does not need any plugins :)
I'll try out your suggestions and will close this issue, when it is working.
Maybe I excpected some configuration like CoC, where you can configure your local coc-settings.json, which will apply all settings to the default configuration.
In this case, if I understand it correctly, I'll have to repeat myself, if I want to configure the lsp with extra options.
But this isn't too annoying and it should be easy to do some scripting to improve this situation on my side.
Anyway thanks for your help! :)

NB: in case you dont know there is :h exrc that can potentially replace your plugin.

Unfortunately I think this is currently broken with init.lua

NB: in case you dont know there is :h exrc that can potentially replace your plugin.

Unfortunately I think this is currently broken with init.lua

NB: in case you dont know there is :h exrc that can potentially replace your plugin.

Unfortunately I think this is currently broken with init.lua

NB: in case you dont know there is :h exrc that can potentially replace your plugin.

Unfortunately I think this is currently broken with init.lua

After getting a bit more comfortable with lua, I've found a solution to the problem that I described in https://github.com/neovim/nvim-lspconfig/issues/383#issuecomment-727573659.
Converting the global lsp config to a module, like so
local M = {}

M.rust_analyzer.settings = {
    ["rust-analyzer"] = {
        ["checkOnSave"] = {
            ["enabled"] = true,
            ["command"] = "clippy",
        },
    },
}

require('lspconfig').rust_analyzer.setup {
    settings = M.rust_analyzer.settings,
    on_attach = -- ...
}

return M

and then acquire that table in the local config file (e.g. .nvimrc)
lua << EOF
-- get the global config
settings = require('mycustom_lspconfig')
-- applying changes, which are unique to the local project
settings["rust-analyzer"]["cargo"] = {
      ["target"] = "thumbv7em-none-eabihf",
}
-- and overwrite the global configuration for the server
-- with the new configuration
require('lspconfig').rust_analyzer.setup {
    settings = settings,
    on_attach = -- ...
}
EOF

This is a solution, sufficient for my usecase. After knowing lua a little better, this solution is quite simple and obvious in hindsight.
But this is not as convenient and obvious as the solution provided by CoC.
However, lspconfig's / builtin lsp's goal isn't to be as convenient as CoC I assume, it does focus more on flexibility.
Maybe the documentation could be improved for beginners? Or is it already documented, and I've just overlooked that part?
I'm willing to contribute to the documentation, but I am not sure about the correct place for this tip and if my solution is the best one.

After getting a bit more comfortable with lua, I've found a solution to the problem that I described in https://github.com/neovim/nvim-lspconfig/issues/383#issuecomment-727573659.
Converting the global lsp config to a module, like so
local M = {}

M.rust_analyzer.settings = {
    ["rust-analyzer"] = {
        ["checkOnSave"] = {
            ["enabled"] = true,
            ["command"] = "clippy",
        },
    },
}

require('lspconfig').rust_analyzer.setup {
    settings = M.rust_analyzer.settings,
    on_attach = -- ...
}

return M

and then acquire that table in the local config file (e.g. .nvimrc)
lua << EOF
-- get the global config
settings = require('mycustom_lspconfig')
-- applying changes, which are unique to the local project
settings["rust-analyzer"]["cargo"] = {
      ["target"] = "thumbv7em-none-eabihf",
}
-- and overwrite the global configuration for the server
-- with the new configuration
require('lspconfig').rust_analyzer.setup {
    settings = settings,
    on_attach = -- ...
}
EOF

This is a solution, sufficient for my usecase. After knowing lua a little better, this solution is quite simple and obvious in hindsight.
But this is not as convenient and obvious as the solution provided by CoC.
However, lspconfig's / builtin lsp's goal isn't to be as convenient as CoC I assume, it does focus more on flexibility.
Maybe the documentation could be improved for beginners? Or is it already documented, and I've just overlooked that part?
I'm willing to contribute to the documentation, but I am not sure about the correct place for this tip and if my solution is the best one.

I think we should add a section on project local settings and include an example similar to the above, however, unless I'm mistaken this is currently broken when using an init.lua (I have exrc enabled) . I personally prefer this approach to coc, since it mimics emacs in where you can define arbitrary editor settings (default formatter, project specific commands) in a way that is significantly more flexible that whatever json options coc affords you.

I think we should add a section on project local settings and include an example similar to the above, however, unless I'm mistaken this is currently broken when using an init.lua (I have exrc enabled) . I personally prefer this approach to coc, since it mimics emacs in where you can define arbitrary editor settings (default formatter, project specific commands) in a way that is significantly more flexible that whatever json options coc affords you.

Related: https://github.com/neovim/neovim/pull/13503

Related: https://github.com/neovim/neovim/pull/13503

You could also do something like this in Vimscript:
let settings = findfile('.settings.lua', '.;')
if !empty(settings)
  luafile settings
endif

Same but in Lua:
local settings = vim.fn.findfile('.settings.lua', '.;')
if settings ~= '' then
  dofile(settings)
end

Ideally it should be called as part of on_attach, or perhaps even better in before_init. Note that I h aven't actually tested the above, so there might be issues with loading order etc. But the general idea should work I think.

You could also do something like this in Vimscript:
let settings = findfile('.settings.lua', '.;')
if !empty(settings)
  luafile settings
endif

Same but in Lua:
local settings = vim.fn.findfile('.settings.lua', '.;')
if settings ~= '' then
  dofile(settings)
end

Ideally it should be called as part of on_attach, or perhaps even better in before_init. Note that I h aven't actually tested the above, so there might be issues with loading order etc. But the general idea should work I think.

I added a note to the wiki on using .exrc for project local settings.

I added a note to the wiki on using .exrc for project local settings.

The problem with that approach is that if Neovim is launched from a desktop launcher the working directory is the user's home directory.
Even changing the working directory from inside Neovim with the :cd command won't take effect on loading the custom local config.

If require('lspconfig').foo.setup is put in both the global and local configs, won't the language server be started twice? Or is the suggestion to only call setup in local configs?

I just ended up having an optional .lspconfig.lua file with local settings:
local f = loadfile(vim.fn.getcwd() .. '/.lspconfig.lua')

if f ~= nil then
    local cfg = f()

    if cfg ~= nil then
        if cfg.rust_analyzer ~= nil then
            print("merging local rust-analyzer config")

            for opt, val in pairs(cfg.rust_analyzer) do
                rust_analyzer[opt] = val
            end
        end
    end
end

exrc is deprecated.

If require('lspconfig').foo.setup is put in both the global and local configs, won't the language server be started twice? Or is the suggestion to only call setup in local configs?

I was also wondering about this. From what I understand, the LS is only launched once, but the second call to setup() replaces its settings?
But I think with the wiki section suggesting exrc/.nvim.lua it would be good to clarify the interaction. From a brief test it seems to work alright for simple use cases


Grafana Custom Configuration

Hi All
I'm trying to deploy grafana behind nginx reverese proxy and I'm not sure how to implement it in the specific deployment we use here
I'm using the kube-prometheus helm chart that has the grafana chart inside it
To make a long story short, I want to expose grafana on an external url such as http://mycluster.mydomain.com/grafana
Can you please point me in the write direction as to what values I need to add / change in the grafana chart to make it work?
Thanks,
Omer

@jungopro I'm several steps behind you, please tell me - what repo are you helming from? Current one simply does not deploy anything for me(

@ksemaev https://github.com/coreos/prometheus-operator/tree/master/helm


Container App Environment fails with infrastructureSubnetId

Bicep version
Bicep CLI version 0.17.1 (d423d61882)
Describe the bug
When deploying a Container App Environment with the infrastructureSubnetId property set to an existing subnet reference with a /23 address size, the deployment fails with the following error:
{
    "status": "Failed",
    "error": {
        "code": "ManagedEnvironmentInvalidNetworkConfiguration",
        "message": "The environment network configuration is invalid: The subnet and its addressPrefix could not be found."
    }
}

The Virtual Network is located in the same subscription in the same resource group and in the same region as the Container App Environment.
To Reproduce
Deploy the following template:
param location string = 'westeurope'

var solutionName = 'sample'
var vNetName = 'vnet-${solutionName}'
var subnetName = 'snet-cae'
var caeName = 'cae-${solutionName}'

resource vNet 'Microsoft.Network/virtualNetworks@2022-11-01' existing = {
  name: vNetName

  resource caeSubnet 'subnets@2022-11-01' existing = {
    name: subnetName
  }
}

resource containerAppEnv 'Microsoft.App/managedEnvironments@2022-10-01' = {
  name: caeName
  location: location
  properties: {
    vnetConfiguration: {
      internal: false
      infrastructureSubnetId: vNet::caeSubnet.id
    }
    zoneRedundant: false
  }
}

Additional context
I have tried copying the actual value of infrastructureSubnetId from the JSON properties of an existing Container App Environment that was created from the portal, but that also failed with the same error during deployment.

This looks like a troubleshooting issue with the Container Apps RP, not Bicep. Can you either open a support case or open this issue in:
https://github.com/microsoft/azure-container-apps/issues
Closing for now, but feel free to re-open if I have misinterpreted.


Add .insn directive

Add .insn directive with brief description and link to full documentation.

I added .insn r OP, 0, 0, a0, a1, a2 so it's the same instruction as the other examples.


Migration class (table migrations) remains empty after executing migrations

It happens due to using reserved word 'batch' in query that inserts new record into migration table.
For instance,
insert into migrations (migration, batch) values ('2015_10_12_161815_create_users_table', 1)

produces Exception:
com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #0: Error parsing query: INSERT INTO migrations (migration, batch) VALUES ('2015_10_12_161815_create_users_table', 1) Encountered " "(" "( "" at line 1, column 24. Was expecting one of: <SELECT> ... <FROM> ... <RETURN> ... <CLUSTER> ...

This makes me think that all previous issues regarding the migrations that I created are related to this finding.

There was some problem in php wrapper for orientdb. I have resolved it. Now migration table is creating along with its fields.


Guys the web link is broken

The website for linuxchixindia is broken, I tried to access it but it failed.

It is in process of being migrated to a custom domain.
We will see to it :)
Thanks

Let's keep it open till the issue is actually fixed.
Currently A records of the domain have to be mapped to Github and DNS propagation would require 24-48 hours.
Once it is resolved we will close this issue.
Thanks!

Sure ... I closed it as I thought it was a known issue.

Yeah, known to us, not to everyone :)
Just to ensure others don't open up the same issue, it's better to keep it open. :)
Thanks for noticing this @mfrw

This is resolved now.
Website has been mapped to http://india.linuxchix.org/
Thanks @shivan1b !
PS: In case someone has still issues, please wait for at least 48 hours from now to let the DNS entries fully propagate. If you still face this issue after that, please consider re-opening this thread.


remove deprecated method in python3.12

Because datetime.datetime.utcnow() was marked deprecated in 3.12, but datetime.UTC was only supported from 3.11. In order to ensure usability, I used sys.version_info to check the current version to apply to lower versions of python. I tested in python2.7, python 3.8, python3.11 and python3.12 respectively, and they were all in line with expectations.

Please merge this!

duplicate of #801 (and would be included in #799 also)?

duplicate of #801 (and would be included in #799 also)?

This pull request is better


Add TravisCI

Reopening of #16

With the addition of the custom settings.xml we managed to get rid of the connection problems to the repository.apache.org's nexus. Now only mavencentral is queried.
Another issue came up. In red a timeout throw by SNV
main] INFO  com.sap.psr.vulas.git.GitClient  - Create dir [/tmp/patcha_svn.apache.org-repos-asf-cxf-] for GIT repo [http://svn.apache.org/repos/asf/cxf/]
[main] ERROR com.sap.psr.vulas.git.GitClient  - Invalid remote for GIT repository at http://svn.apache.org/repos/asf/cxf/
[main] ERROR com.sap.psr.vulas.git.GitClient  - Deleted temp. directory [/tmp/patcha_svn.apache.org-repos-asf-cxf-]
[main] ERROR com.sap.psr.vulas.patcha.PatchAnalyzer  - VCS client com.sap.psr.vulas.git.GitClient (type GIT) does not match to the repository (if any) at URL http://svn.apache.org/repos/asf/cxf/
[main] ERROR com.sap.psr.vulas.patcha.PatchAnalyzer  - Root cause: VCS client com.sap.psr.vulas.git.GitClient (type GIT) does not match to the repository (if any) at URL http://svn.apache.org/repos/asf/cxf/
[main] INFO  com.sap.psr.vulas.svn.SvnClient  - SVNKIT proxy configuration (host:port): null:0
+ [main] INFO  com.sap.psr.vulas.svn.SvnClient  - Revision '1438424' : [CVE-2013-0239][CXF-4776] - Fix + re-enable tests
- org.tmatesoft.svn.core.SVNException: svn: E175002: timed out waiting for server

Here the relevant log
[main] INFO  com.sap.psr.vulas.git.GitClient  - Create dir [/tmp/patcha_svn.apache.org-repos-asf-cxf-] for GIT repo [http://svn.apache.org/repos/asf/cxf/]
[main] ERROR com.sap.psr.vulas.git.GitClient  - Invalid GIT repository at http://svn.apache.org/repos/asf/cxf/
[main] ERROR com.sap.psr.vulas.git.GitClient  - Deleted temp. directory [/tmp/patcha_svn.apache.org-repos-asf-cxf-]
[main] ERROR com.sap.psr.vulas.patcha.PatchAnalyzer  - VCS client com.sap.psr.vulas.git.GitClient (type GIT) does not match to the repository (if any) at URL http://svn.apache.org/repos/asf/cxf/
[main] ERROR com.sap.psr.vulas.patcha.PatchAnalyzer  - Root cause: VCS client com.sap.psr.vulas.git.GitClient (type GIT) does not match to the repository (if any) at URL http://svn.apache.org/repos/asf/cxf/
[main] INFO  com.sap.psr.vulas.svn.SvnClient  - SVNKIT proxy configuration (host:port): null:0
org.tmatesoft.svn.core.SVNException: svn: E175002: timed out waiting for server
svn: E175002: OPTIONS request failed on '/repos/asf/cxf'
	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:112)
	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:96)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:765)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:352)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:340)
	at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:910)
	at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:702)
	at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:113)
	at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1035)
	at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.testConnection(DAVRepository.java:75)
	at com.sap.psr.vulas.svn.SvnClient.setupRepo(SvnClient.java:120)
	at com.sap.psr.vulas.svn.SvnClient.setRepoUrl(SvnClient.java:86)
	at com.sap.psr.vulas.patcha.PatchAnalyzer.createVCSClient(PatchAnalyzer.java:121)
	at com.sap.psr.vulas.patcha.PatchAnalyzer.setRepoURL(PatchAnalyzer.java:85)
	at com.sap.psr.vulas.patcha.PatchAnalyzer.<init>(PatchAnalyzer.java:64)
	at com.sap.psr.vulas.patcha.IT01_PatchAnalyzerIT.testSvnRepo(IT01_PatchAnalyzerIT.java:32)

This exception is randomly thrown based on the connection to http://svn.apache.org/repos/asf/cxf/

The failing test is here: https://github.com/SAP/vulnerability-assessment-tool/blob/cb6ef07fcdf60aa48fd743edc45378b087a98866/patch-analyzer/src/test/java/com/sap/psr/vulas/patcha/IT01_PatchAnalyzerIT.java#L18

I think it makes sense to use the following option in the Travis job: -DexcludedGroups="com.sap.psr.vulas.shared.categories.Slow"
It is meant to exclude long-running tests, many of which require network connectivity.

@henrikplate as far as I understood, we can only have one job on travis.
Anyway, to summarize the discussion we have earlier, a possible strategy could be:

Immediate: disable the flaky tests for now, so that we can have meaningful support from travis when evaluating PRs
mid-term: improve tests by reducing their scope and, wherever possible, by removing dependencies on network access.

After taking a quick look into this, I came to the following conclusion:

When calling mvn test all java files in src/test/java are compiled to the folder target/test-classes
Also all files in src/test/resources/ are copied into  target/test-classes
By default maven surfire only executes classes ending with *Test see http://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html
invoking mvn -Dtest=! seems to overwrite the default behavior
Thus, maven tries to execute all classes in the folder target/test-classes, also the classes, that have been copied into it from the resource folder. This explains the error message
When invoking  mvn clean test '-Dtest=!IT01_PatchAnalyzerIT, *Test', the tests do not fail, because maven only loads classes that end with *Test

IMHO: A clean solution would be the exclusion of this test using its fqn in a pom file

In my opinion, tests with postfix IT are meant to be executed by the maven-failsafe-plugin: https://maven.apache.org/surefire/maven-failsafe-plugin
https://maven.apache.org/surefire/maven-failsafe-plugin/examples/skipping-tests.html explains how to skip integration tests.
https://maven.apache.org/surefire/maven-failsafe-plugin/examples/inclusion-exclusion.html explains how to include/exclude tests.
https://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html explains all the options of goal integration-test.

By adding the .m2 cache back again we gained 2 minutes

@henrikplate mergeable

Useful resource for the future if we want to integrate to the test the docker build phase.
https://stackoverflow.com/a/44054333/3482533


fix($q): allow third-party promises

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
For testing, it can be useful to run with other promise
implementations like Bluebird.js + angular-bluebird-promises. This
broke in angularjs 1.6 with a "TypeError: Cannot set property 'pur' of
undefined".
Closes #16164
What is the current behavior? (You can also link to an open issue here)
Raises TypeError: Cannot set property 'pur' of undefined
What is the new behavior (if this is a feature change)?
N/A
Does this PR introduce a breaking change?
No
Please check if the PR fulfills these requirements

[ ] The commit message follows our guidelines
[ ] Fix/Feature: Docs have been added/updated
[ ] Fix/Feature: Tests have been added; existing tests pass

Other information:

@vbraun - thanks for sending this in.
Have you tested that this then works with Bluebird?

I'm using kriskowal's Q with jsdom for some tests, and I can confirm that it works with that combination. On #16164 the reporter indicated that it works with Bluebird but I haven't confirmed that personally.
Not sure about unit tests, of course one could try various third-party libraries but would be quite some effort... Or just manually delete the q.$$state?

We decided it is not worth adding tests for the specific issue that this PR solves, since substituting $q with another promise library is neither thoroughly tested, nor officially supported (although it seems to be possible). So, even if we tested that nothing breaks due to missing $$state, there is still no guarrantee that something else doesn't break.
We can land this as is (with a comment explaining what these lines guard against).

Tweaked a bit and merged.

BTW, if anyone can't upgrade to the latest AngularJS version, it is possible to work around this issue by adding a $$state: {} property on the promise prototype. For example, in the case of Bluebird + angular-bluebird-promises (demo):
.config(Bluebird => Bluebird.prototype.$$state = {})


REQUIRE => REQUIRES so a test is actually disabled.

Title says it all.

@swift-ci Please smoke test and merge

This should fix the build.

Eh, sorry; just force-merged the same fix to get it in faster.

Ok. Thanks!


feat: port RingTheory.Localization.NumDen

1 simpNF linter message left

Is there some reason for the rename denom -> den?

Is there some reason for the rename denom -> den?

The two fields of the Rat type in mathlib4 are num and den, whereas the latter was denom in mathlib3. Do you want it changed back to denom here?

That sounds like a good reason.
bors r+


xschem: fix paths

fix symbols path
fix models extension

/cc @atorkmabrains @StefanSchippers

This ready to go @proppy

@proppy @mithro Are you going to merge?


Failure Following DISABLE

So I'm using way-displays to control screen idle action via swayidle:
swayidle -w timeout 150 "way-displays -s DISABLED eDP-1" resume "way-displays -d DISABLED eDP-1"
this worked fine until the upgrade a few days ago but now, it tells me display is disabled, even though it clearly is not:
Client sending request: set
  Disabled:
    eDP-1

Server received request: set
  Disabled:
    eDP-1

New configuration:
  Arrange in a ROW aligned at the TOP
  Scaling: ON
  Auto scale: OFF
  Disabled:
    eDP-1
ERROR: way-displays not running, check $XDG_VTNR

the last line happens when  the resume is supposed to kick in. Other than this hiccup, this has been a pretty awesome and handy utility!

It looks like the server died when setting DISABLED. I'll look into that.
Which version are you running? way-displays --version
Has this ever worked or is this a new problem?

regression at 393fdd8

This should be resolved by 1.8.1.
Please watch Package Manager for your distribution.

sorry, was out and about. This was working and stable on version 1.7.1. It started with 1.8.0 and I just installed 1.8.1 which seems to resolve the issue. Thanks for being so on top of things!


mr_list: Support search

Search is as useful for merge requests as for issues, so support
the same option as lab issue list.

@fmuellner do you think it would be useful a "--full-match" flag for adding double-quotes in the terms and forcing that "exact" (it still is case insensitive) match?
It would basically be the same as lab issue search "\"search terms\"".

@fmuellner do you think it would be useful a "--full-match" flag for adding double-quotes in the terms and forcing that "exact" (it still is case insensitive) match?
It would basically be the same as lab issue search "\"search terms\"".

do you think it would be useful a "--full-match" flag for adding double-quotes in the terms and forcing that "exact" (it still is case insensitive) match?
It would basically be the same as lab issue search "\"search terms\"".

Do you mean to both lab mr list and lab issue list? IMHO those two commands should be as consistent as possible.
That said, a flag does sound more convenient than escaping quotes on the command line. I'd prefer --exact-match over --full-match though - the latter suggests something like full-text search (i.e. searching comments as well) to me.

do you think it would be useful a "--full-match" flag for adding double-quotes in the terms and forcing that "exact" (it still is case insensitive) match?
It would basically be the same as lab issue search "\"search terms\"".

Do you mean to both lab mr list and lab issue list? IMHO those two commands should be as consistent as possible.
That said, a flag does sound more convenient than escaping quotes on the command line. I'd prefer --exact-match over --full-match though - the latter suggests something like full-text search (i.e. searching comments as well) to me.

do you think it would be useful a "--full-match" flag for adding double-quotes in the terms and forcing that "exact" (it still is case insensitive) match?
It would basically be the same as lab issue search "\"search terms\"".

Do you mean to both lab mr list and lab issue list?

do you think it would be useful a "--full-match" flag for adding double-quotes in the terms and forcing that "exact" (it still is case insensitive) match?
It would basically be the same as lab issue search "\"search terms\"".

Do you mean to both lab mr list and lab issue list?

do you think it would be useful a "--full-match" flag for adding double-quotes in the terms and forcing that "exact" (it still is case insensitive) match?
It would basically be the same as lab issue search "\"search terms\"".

Do you mean to both lab mr list and lab issue list? IMHO those two commands should be as consistent as possible.

Yes! Sorry. It must be for both :)

That said, a flag does sound more convenient than escaping quotes on the command line. I'd prefer --exact-match over --full-match though - the latter suggests something like full-text search (i.e. searching comments as well) to me.

Hmm, although I agree with your concerning with --full-match I also think --exact-match misleading, since it gives the impression of a case-sensitive search, which is not. What about only --match ?

do you think it would be useful a "--full-match" flag for adding double-quotes in the terms and forcing that "exact" (it still is case insensitive) match?
It would basically be the same as lab issue search "\"search terms\"".

Do you mean to both lab mr list and lab issue list? IMHO those two commands should be as consistent as possible.

Yes! Sorry. It must be for both :)

That said, a flag does sound more convenient than escaping quotes on the command line. I'd prefer --exact-match over --full-match though - the latter suggests something like full-text search (i.e. searching comments as well) to me.

Hmm, although I agree with your concerning with --full-match I also think --exact-match misleading, since it gives the impression of a case-sensitive search, which is not. What about only --match ?

What about only --match ?

Maybe as a string flag (lab issue list --match="foo bar" instead of lab issue list "foo bar" - but then what about lab issue list --match="foo bar" baz?). For a boolean, the name sounds too generic to me.

I also think --exact-match is somewhat misleading, since it gives the impression of a case-sensitive search

Right, that's a concern.
OTOH, both Google and DuckDuckGo use "exact match/term":
https://support.google.com/websearch/answer/2466433?hl=en
https://help.duckduckgo.com/duckduckgo-help-pages/results/syntax/
And in both cases, the search is case insensitive (in fact, searching for "cats and dogs" turns up "Cats & Dogs" as top result in both for me)

What about only --match ?

Maybe as a string flag (lab issue list --match="foo bar" instead of lab issue list "foo bar" - but then what about lab issue list --match="foo bar" baz?). For a boolean, the name sounds too generic to me.

I also think --exact-match is somewhat misleading, since it gives the impression of a case-sensitive search

Right, that's a concern.
OTOH, both Google and DuckDuckGo use "exact match/term":
https://support.google.com/websearch/answer/2466433?hl=en
https://help.duckduckgo.com/duckduckgo-help-pages/results/syntax/
And in both cases, the search is case insensitive (in fact, searching for "cats and dogs" turns up "Cats & Dogs" as top result in both for me)

What about only --match ?

Maybe as a string flag (lab issue list --match="foo bar" instead of lab issue list "foo bar" - but then what about lab issue list --match="foo bar" baz?). For a boolean, the name sounds too generic to me.

Yeah.. using it as a string would be confusing.

I also think --exact-match is somewhat misleading, since it gives the impression of a case-sensitive search

Right, that's a concern.
OTOH, both Google and DuckDuckGo use "exact match/term":
https://support.google.com/websearch/answer/2466433?hl=en
https://help.duckduckgo.com/duckduckgo-help-pages/results/syntax/
And in both cases, the search is case insensitive (in fact, searching for "cats and dogs" turns up "Cats & Dogs" as top result in both for me)

Hmmm. let's use --exact-match then. However, if possible, let it clear that the search is case-insensitive in the flag description.
Thanks @fmuellner !

What about only --match ?

Maybe as a string flag (lab issue list --match="foo bar" instead of lab issue list "foo bar" - but then what about lab issue list --match="foo bar" baz?). For a boolean, the name sounds too generic to me.

Yeah.. using it as a string would be confusing.

I also think --exact-match is somewhat misleading, since it gives the impression of a case-sensitive search

Right, that's a concern.
OTOH, both Google and DuckDuckGo use "exact match/term":
https://support.google.com/websearch/answer/2466433?hl=en
https://help.duckduckgo.com/duckduckgo-help-pages/results/syntax/
And in both cases, the search is case insensitive (in fact, searching for "cats and dogs" turns up "Cats & Dogs" as top result in both for me)

Hmmm. let's use --exact-match then. However, if possible, let it clear that the search is case-insensitive in the flag description.
Thanks @fmuellner !

Hi, due to no fault of yours the lab test code was broken.  I have fixed the tests in #575 and #573 .  Can you please rebase to see if your build will past testing?  My sincere apologies for the inconvenience.

Hi, due to no fault of yours the lab test code was broken.  I have fixed the tests in #575 and #573 .  Can you please rebase to see if your build will past testing?  My sincere apologies for the inconvenience.


Add mbed support for malloc() and free()

This PR adds Mbed support for erpc_malloc() and erpc_free().
@AGlass0fMilk

Hello @trowbridgec , in case standard malloc() and free() functions are used the erpc_port_stdlib.cpp can be utilized. I do not think it is neccessary to introduce this file, unless there are any mbedOS-specific allocator functions to be used.

Hi @MichalPrincNXP,
As it turns out, since the erpc_port_stdlib.cpp file also provides definitions for the new and delete operators, when I use that file with Mbed, I get linker errors complaining of multiple definitions for new and delete since Mbed's sources already define them.
From what I can tell, it looks like Mbed support really just requires defining the erpc_malloc() and erpc_free() functions. What's the best way to handle that: a separate Mbed-specific porting file? adding a #if to erpc_port_stdlib.cpp to check what platform is being used?
Thanks!

Hi @trowbridgec , thanks, then I am OK with having this mbed-specific file and would accept this PR. @AGlass0fMilk could you please review and confirm adding this source that will be of your interest?

@AGlass0fMilk , could you please review and confirm adding this source that will be of your interest? Thank you. M.

@AGlass0fMilk , did you have a chance to make the review of this PR? Please let us know. Thanks.

LGTM, I have no problem with introducing this.

Thank you @trowbridgec
Michal


Setup general email account

Signed-off-by: Jorma Virkkunen<EMAIL_ADDRESS>

Looks good to me, however there is one empty space on line 128 which causes that the bold font doesn't work:
**Q: I can only receive emails, but cannot send any
**

Looks good to me, however there is one empty space on line 128 which causes that the bold font doesn't work: **Q: I can only receive emails, but cannot send any **

Fixed in commit 816063...


[$250] iOS - IOU/Expense - Expense report disappears for receiver after another expense sent

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Version Number: <IP_ADDRESS>
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team
Action Performed:

Open the app and log in as user A
On the secondary device log in as user B
User B - start a chat with user A and submit an IOU
User A - open the chat with user B
User B - submit another money request

Expected Result:
The IOU report is still displayed and updated in the chat for user A
Actual Result:
The IOU report disappears from the chat for user A. It appears after re-opening the chat
The same happens to the workspace when admin has the chat with the submitter open, and submitter submits an expense
Workaround:
Unknown
Platforms:

Which of our officially supported platforms is this issue occurring on?

[ ] Android: Standalone
[ ] Android: HybridApp
[ ] Android: mWeb Chrome
[x] iOS: Standalone
[x] iOS: HybridApp
[ ] iOS: mWeb Safari
[ ] MacOS: Chrome / Safari
[ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/57a2f0fe-aa5c-4277-abbd-ae9b934a219b
View all open jobs on GitHub
Upwork Automation - Do Not Edit

Upwork Job URL: https://www.upwork.com/jobs/~021869141833343729726
Upwork Job ID:<PHONE_NUMBER>343729726
Last Price Increase: 2024-12-24

Issue OwnerCurrent Issue Owner: @eh2077

When receiver got a report, data is given too. The data should be saved into Onyx but some data is short of. I tried to find RCA from frontend but I think it's the response from BE API. The process is like :
User B sent a IOU -> BE got requested and response -> User A got the response w/o some null data
This happens on safari browser too so it should be fixed as soon.
The response has reportPreviews null value:
[Debug] [info] [Report] Handled multipleEvents event sent by Pusher - {"updates":[{"data":[{"key":"report_4715962770440927","onyxMethod":"merge","value":{"participants":{"18602521":{"notificationPreference":"always"},"18608989":{"notificationPreference":"always"}}}},{"key":"report_5056132861724186","onyxMethod":"merge","value":{"participants":{"18602521":{"notificationPreference":"hidden"},"18608989":{"notificationPreference":"hidden"}}}},{"key":"report_5056132861724186","onyxMethod":"merge","value":{"chatType":"","description":"","lastActorAccountID":18602521,"lastMessageText":"$2.00 expense","lastVisibleActionCreated":"2024-11-24 08:06:29.360","managerID":18608989,"ownerAccountID":18602521,"parentReportActionID":"8257696270353284148","parentReportID":"4715962770440927","policyID":"DE7CFAC452692A30","reportID":"5056132861724186","reportName":"IOU","state":"SUBMITTED","stateNum":1,"statusNum":1,"type":"iou","visibility":null}},{"key":"reportActions_5056132861724186","onyxMethod":"merge","shouldShowPushNotification":true,"value":{"6352836909445551824":{"actionName":"IOU","actorAccountID":18602521,"avatar":"https://d1wpcgnaa73g0y.cloudfront.net/dde9b25553f8c6083e761caff3b0580ba7f9063c_128.jpeg","created":"2024-11-24 08:06:29.360","lastModified":"2024-11-24 08:06:29.360","message":[{"html":"$2.00 expense","text":"$2.00 expense","type":"COMMENT","whisperedTo":[]}],"originalMessage":{"IOUReportID":5056132861724186,"IOUTransactionID":"6030795909271996205","amount":200,"comment":"","currency":"USD","isNewDot":true,"lastModified":"2024-11-24 08:06:29.360","participantAccountIDs":[18602521,18608989],"type":"create"},"person":[{"style":"strong","text":"h8u","type":"TEXT"}],"reportActionID":"6352836909445551824","shouldShow":true}}},{"key":"reportActions_4715962770440927","onyxMethod":"merge","value":{"8257696270353284148":{"actionName":"REPORTPREVIEW","actorAccountID":18602521,"avatar":"https://d1wpcgnaa73g0y.cloudfront.net/dde9b25553f8c6083e761caff3b0580ba7f9063c_128.jpeg","childCanHold":true,"childCanUnhold":false,"childCommenterCount":0,"childLastActorAccountID":18602521,"childLastMoneyRequestComment":"","childLastReceiptTransactionIDs":"","childLastVisibleActionCreated":"","childMoneyRequestCount":4,"childOldestFourAccountIDs":"","childRecentReceiptTransactionIDs":[],"childReportNotificationPreference":"hidden","childType":"iou","childVisibleActionCount":0,"created":"2024-11-12 12:47:20.745","lastModified":"2024-11-12<EMAIL_ADDRESS>owes<EMAIL_ADDRESS>owes $10.00","type":"COMMENT","whisperedTo":[]}],"originalMessage":{"isNewDot":true,"lastModified":"2024-11-12 12:47:20.745","linkedReportID":"5056132861724186"},"person":[{"style":"strong","text":"h8u","type":"TEXT"}],"reportActionID":"8257696270353284148","shouldShow":true}}},{"key":"personalDetailsList","onyxMethod":"merge","value":{"18602521":{"accountID":18602521,"avatar":"https://d1wpcgnaa73g0y.cloudfront.net/dde9b25553f8c6083e761caff3b0580ba7f9063c_128.jpeg","displayName":"h8u","firstName":"h8u","lastName":"","login":"jacobkim9881+111<EMAIL_ADDRESS>owes<EMAIL_ADDRESS>owes $12.00","type":"COMMENT","whisperedTo":[]}],"originalMessage":{"isNewDot":true,"lastModified":"2024-11-12 12:47:20.745","linkedReportID":"5056132861724186"}}}},{"key":"reportActions_4715962770440927","onyxMethod":"merge",

///////////////////////////////// Report preview has null value ////////////////
"value":{"8257696270353284148":null}},
///////////////////////////////// Report preview has null value ////////////////

{"key":"transactions_6030795909271996205","onyxMethod":"merge","value":{"amount":200,"bank":"","billable":false,"cardID":0,"cardName":"Cash Expense","cardNumber":"","category":"","comment":{"comment":""},"created":"2024-11-24","currency":"USD","filename":"","hasEReceipt":false,"managedCard":false,"mcc":"","merchant":"(none)","modifiedAmount":0,"modifiedCreated":"","modifiedCurrency":"","modifiedMCC":"","modifiedMerchant":"","originalAmount":0,"originalCurrency":"","parentTransactionID":"","receipt":{},"reimbursable":true,"reportID":"5056132861724186","status":"Posted","tag":"","transactionID":"6030795909271996205"}},{"key":"report_5056132861724186","onyxMethod":"merge","value":{"avatarUrl":null,"chatReportID":"4715962770440927","chatType":"","currency":"USD","description":"","errorFields":{"export":null,"notFound":null},"fieldList":null,"hasOutstandingChildRequest":false,"hasOutstandingChildTask":false,"hasParentAccess":true,"invoiceReceiver":null,"iouReportID":null,"isCancelledIOU":false,"isDeletedParentAction":null,"isOwnPolicyExpenseChat":false,"isPinned":false,"isWaitingOnBankAccount":false,"lastActionType":"IOU","lastActorAccountID":"18602521","lastMentionedTime":null,"lastMessageHtml":"$2.00 expense","lastMessageText":"$2.00 expense","lastReadSequenceNumber":0,"lastReadTime":"2024-11-24 06:55:04.923","lastVisibleActionCreated":"2024-11-24 08:06:29.360","lastVisibleActionLastModified":"2024-11-24 08:06:29.360","managerID":18608989,"nonReimbursableTotal":0,"oldPolicyName":"","ownerAccountID":18602521,"parentReportActionID":"8257696270353284148","parentReportID":"4715962770440927","participants":{"18602521":{"notificationPreference":"hidden"},"18608989":{"notificationPreference":"hidden"}},"permissions":[],"policyAvatar":null,"policyID":"DE7CFAC452692A30","policyName":null,"private_isArchived":"","reportID":"5056132861724186","reportName":"IOU","stateNum":1,"statusNum":1,"total":1200,"tripData":null,"type":"iou","unheldNonReimbursableTotal":0,"unheldTotal":1200,"visibility":null,"welcomeMessage":"","writeCapability":"all"}},{"key":"reportNameValuePairs_5056132861724186","onyxMethod":"merge","value":{"type":"iou"}},{"key":"report_4715962770440927","onyxMethod":"merge","value":{"hasOutstandingChildRequest":true}},{"key":"transactionViolations_","onyxMethod":"mergecollection","value":{"transactionViolations_1099014878132920519":null,"transactionViolations_6030795909271996205":null,"transactionViolations_7133866576145464058":null,"transactionViolations_871741006313844837":null}},{"key":"report_5056132861724186","onyxMethod":"merge","value":{"lastActorAccountID":18602521,"lastMessageText":"$2.00 expense","lastVisibleActionCreated":"2024-11-24 08:06:29.360","maxSequenceNumber":4,"reportID":"5056132861724186"}},{"key":"reportActions_5056132861724186","onyxMethod":"merge","shouldNotify":true,"value":{"6352836909445551824":{"actionName":"IOU","actorAccountID":18602521,"automatic":false,"avatar":"https://d1wpcgnaa73g0y.cloudfront.net/dde9b25553f8c6083e761caff3b0580ba7f9063c_128.jpeg","childReportID":"8950426979700607","childReportNotificationPreference":"hidden","childType":"chat","created":"2024-11-24 08:06:29.360","isAttachment":false,"lastModified":"2024-11-24 08:06:29.360","message":[{"deleted":"","html":"$2.00 expense","isDeletedParentAction":false,"isEdited":false,"reactions":[],"text":"$2.00 expense","type":"COMMENT","whisperedTo":[]}],"originalMessage":{"IOUReportID":5056132861724186,"IOUTransactionID":"6030795909271996205","amount":200,"comment":"","currency":"USD","isNewDot":true,"lastModified":"2024-11-24 08:06:29.360","participantAccountIDs":[18602521,18608989],"type":"create"},"person":[{"style":"strong","text":"h8u","type":"TEXT"}],"reportActionID":"6352836909445551824","reportActionTimestamp":1732435589360,"sequenceNumber":4,"shouldShow":true,"timestamp":1732435589,"whisperedToAccountIDs":[]}}},{"key":"report_5056132861724186","onyxMethod":"merge","value":{"avatarUrl":null,"chatReportID":"4715962770440927","chatType":"","currency":"USD","description":"","errorFields":{"export":null,"notFound":null},"fieldList":null,"hasOutstandingChildRequest":false,"hasOutstandingChildTask":false,"hasParentAccess":true,"invoiceReceiver":null,"iouReportID":null,"isCancelledIOU":false,"isDeletedParentAction":null,"isOwnPolicyExpenseChat":false,"isPinned":false,"isWaitingOnBankAccount":false,"lastActionType":"IOU","lastActorAccountID":"18602521","lastMessageHtml":"$2.00 expense","lastMessageText":"$2.00 expense","lastReadSequenceNumber":0,"lastVisibleActionCreated":"2024-11-24 08:06:29.360","lastVisibleActionLastModified":"2024-11-24 08:06:29.360","managerID":18608989,"nonReimbursableTotal":0,"oldPolicyName":"","ownerAccountID":18602521,"parentReportActionID":"8257696270353284148","parentReportID":"4715962770440927","participants":{"18602521":{"notificationPreference":"hidden"},"18608989":{"notificationPreference":"hidden"}},"permissions":["read","write"],"policyAvatar":null,"policyID":"DE7CFAC452692A30","policyName":null,"private_isArchived":"","reportID":"5056132861724186","reportName":"IOU","stateNum":1,"statusNum":1,"total":1200,"tripData":null,"type":"iou","unheldNonReimbursableTotal":0,"unheldTotal":1200,"visibility":null,"welcomeMessage":"","writeCapability":"all"}},{"key":"reportNameValuePairs_5056132861724186","onyxMethod":"merge","value":{"type":"iou"}},{"key":"report_4715962770440927","onyxMethod":"merge","value":{"iouReportID":"5056132861724186"}}],"eventType":"onyxApiUpdate"}],"lastUpdateID":3087145608,"previousUpdateID":3087021056} – ""

It seems not reproducible.

It's off topic but I add another issue. It's because this one occurs from reports thread and gets missing data from BE by Pusher.

UserA create an expense to User B.
Repeat 1
User B goes open the report preview.
User B open one of expense in the report thread.
User A goes to Reports bottom tab.
User A goes to Expenses tab.
User A selects the 2 expense and delete.
Check from UserB's side

Expected
User B goes to streams up to the chat with User A.
Actual
User B have skeleton loading on the report screen.
https://github.com/user-attachments/assets/710188f7-d1ea-4a3a-8662-49d4789a65ff

Issue not reproducible during KI retests. (First week)

Issue not reproducible


Add stack canaries to both the payload and the loader

The commit message mentions the payload, but I'm pretty sure they are also added to the loader.

You are absolutely correct ! I have updated the commit message to reflect this.


Use log not show in tests

Every _show: function has a corresponding _log: function.  Testfiles should probably use the _log functions, as they avoid showing line numbers and the ugly <recently read> } that carries no information.

sounds like a plan

Done in r5772.