Add org-ref and org-roam-bibtex to :tools/biblio

org-ref allows for easy citation management and provides numerous interfaces to online publishing and reference management tools.
org-roam-bibtex provides deep integration of bibtex-completion and {ivy,helm}-bibtex into the org-roam workflow.

While you wait on a review, two things:

@patrl asked on #2861 what happens if one just have either the ivy or helm feature selected. I suggested we include in the README that the module depends on one.
depending on time, we should add the new org-roam-bibtex extension, which tightly integrates org-roam and ivy/helm-bibtex and org-ref; would be dependent on the +roam feature

Also, just saw this; bibtex-completion is being split from ivy/helm-bibtex. Does it impact us?
Guessing not, but just thought I'd ask.

Also, just saw this; bibtex-completion is being split from ivy/helm-bibtex. Does it impact us?
Guessing not, but just thought I'd ask.es it did as doom/upgrade has been failing for the last hours. I am converted to being a :pin advocate

it did as doom/upgrade has been failing for the last hours. I am converted to being a :pin advocate

While you wait on a review, two things:

@patrl asked on #2861 what happens if one has neither the ivy or helm feature selected. I suggested we include in the README that the module depends on one.
Depending on your time (though it should be easy; doesn't appear to require much or any config), we should add the new org-roam-bibtex extension, which tightly integrates org-roam and ivy/helm-bibtex and org-ref, and has been submitted to MELPA. This would need to be dependent on the org +roam feature.

Yes I will do this, once the package in in melpa

This looks good. It adds documentation, and significant new functionality, to the new biblio package.
I've tested it, and it works as I expect.

I've noticed that a a lot of bibliographical packages want to specify the same patterns as user options:

pdf directory path
path to default bibliographical files
path to bibliographical notes

So I propose to expose the next user options on top of config.el:
(defvar +biblio-pdf-library-dir "~/Documents/Library/"
  "Directory where pdf files are stored. Must end with a slash.")

(defvar +biblio-default-bibliography-files '("~/Documents/Biblio/biblio.bib")
  "A list of default bibtex files to use.")

(defvar +biblio-notes-path "~/Documents/Notes/"
  "The place where you will store your notes for bibliography files.

This can be either a single file or directory of files.
In case of directory the path must end with a slash.")

They can affect next variables:

+biblio-default-bibliography-files:

bibtex-completion-library-path
org-ref-pdf-directory

+biblio-default-bibliography-files:

reftex-default-bibliography
bibtex-completion-bibliography
org-ref-default-bibliography

+biblio-notes-path:

bibtex-completion-notes-path
org-ref-bibliography-notes
org-ref-notes-directory

This would simplify and unify the whole interface better.

I've noticed that a a lot of bibliographical packages want to specify the same patterns as user options:

Yes, I've noticed (and grumbled about) that too.
...

So I propose to expose the next user options on top of config.el:
...
This would simplify and unify the whole interface better for the end user.

+1

I also remember that back in time I had difficulties understand how all those packages suppose to work together. We can briefly describe them in the documentation or just link to (or include as a quote block) this reddit thread.

This would simplify and unify the whole interface better for the end user.

I totally agree. I had thought of something similar when doing it, but then discounted the idea because many folks are coming from own configs, so having different variants helm-bibtex, bibtex complete, org-ref .... So I was figuring that the permutation checking might be a mess. But having said that they can always use the standard (after! ...) if they wish and ignore the +biblio variables and just the packages directly.
I will send an update in a few.

I also remember that back in time I had difficulties to understand how all those packages suppose to work together. We can very briefly describe their roles in the documentation.
As a reference, there's a reddit thread that already does so, but not briefly.

Thanks for the link. That will surely help!

@Wetlize, you raise another issue that @bdarcus and I debated a bit. Should org-noter be under the biblio module or as +noter under org/contrib? Technically you do not need the biblo packages to take notes, however, who takes notes that does not in some way use the biblio packages?

@brianmcgillion I think we should keep them separated. One can think about annotations and bibliography as 2 different things. The bibliography module can just reference :lang org +noter somehow in the documentation, as a potential object of interest.

would crossreferencing the setting of the notes path be too much confusion? so from noter,
(if (fboundp +biblio-notes-path)
    (setq org-noter-notes-search-path  +biblio-notes-path))

or something to that effect?

would cross-referencing the setting of the notes path be too much confusion?

I think we should avoid doing so and keep it dumb as for now (i.e. just default org-noter-notes-search-path to org-directory). In future, if users will find this confusing and not intuitive we can change how org-noter (and maybe other org related bibliography packages) will integrate with the rest of Doom.

rebase and bump the biblio packages

rebased, and updated the time stamp

Any chance we can get this merged soon @hlissner? Anything we're missing?

Rebased and bump the pins

Sorry for the delay. As I'm very new to bibtex, org-roam and org-ref, reviewing this is taking me a while; digging through these packages. There are few pain points I'm looking for alternatives around:

The three defcustoms. I'd like not to introduce new variables, and am investigating a way around these; especially because we do not use defcustom anywhere else. I want to avoid them.

We have a lot of (unless X (setq X DEFAULTS)), and I'm going through each of their upstream defaults to see if these checks are warranted (or if we could simply define them in their respective defvars.

I don't fully understand the relationship between org-ref and bibtex-completion, and wonder why :after (org bibtex-completion) is necessary. This complicates the customization path for the user, because neither (after! org ...) nor (after! bibtex-completion ...) will be enough to configure the package (and due to use-package's weird :after semantics, any config in (after! org-ref ...) will be overruled by what's in this module's :config block for it.

I'll keep you posted as I truck along.

Thanks for the update @hlissner.
Given how common it is to integrate these tools (and related, how commonly people get confused how they're supposed to fit together), perhaps your investigations can lead to suggestions upstream.

@brianmcgillion - you might bump org-roam-bibtex again, as they just issued a new release, with new features.

Thank you @hlissner for the thorough review.

The three defcustoms. If possible, I'd like to avoid introducing new variables, and am investigating a way around these; especially because we do not use defcustom anywhere else.
We have a lot of (unless X (setq X DEFAULTS)), and I'm going through each of their upstream defaults to see if these checks are warranted (or if we could simply define them in their respective defvars).

The first drafts used the (unless ... set...) form as seen in other modules. It was suggested by @Wetlize https://github.com/hlissner/doom-emacs/pull/2888#issuecomment-616712460 that it would greatly cleanup the interface if we reduce the multiple packages "file path" variables down to just 3 which would then set them in the respective packages.
The problem stems from the packages providing some level of functionality for bibliographic management but there is not one overarching package tying them together, e.g. reftex-default-bibliography, org-ref-default-bibliography,  bibtex-completion-bibliography all point to the same place and all have to be set, (to the confusion of most users). In the documentation, we indicate how the user can set the variables directly if they so wish rather than using the defcustom.

3. I don't fully understand the relationship between org-ref and bibtex-completion, and wonder why :after (org bibtex-completion) is necessary. This complicates the customization path for the user, because neither (after! org ...) nor (after! bibtex-completion ...) will be enough to configure the package (and due to use-package's :after semantics, any config in a user's (after! org-ref ...) will be overruled).

Will be fixed in the next push. I believe that after! org will be sufficient, as the bibtex-completion will be loaded before this.

If I might chime in here as someone who is already using this merge request:
IMHO the module is not documented enough for people who are new to reference managment or consider switching from more mainstream programs like zotero or citavi. For example, the linked reddit post in the current readme only considers papers but books or online sources are not touched upon. Especially org-ref and its corresponding packages are neither documented very well nor easily discoverable for the new user. Maybe implementing a dedicated keybinding layer would be sufficient to make discoverability easier. This might not be up to the task for the current PR but should be considered.
I'd help with documenting if my skills suffice.
Some ideas about approaching this documentation:

What to do if drag-n-drop fails?
What if there is no DOI?
How to add entries manually

If I might chime in here as someone who is already using this merge request:
IMHO the module is not documented enough for people who are new to reference managment or consider switching from more mainstream programs like zotero or citavi. For example, the linked reddit post in the current readme only considers papers but books or online sources are not touched upon. Especially org-ref and its corresponding packages are neither documented very well nor easily discoverable for the new user.

I agree with all of the above.
It's related to the problem @brianmcgillion noted just above that the functionality is spread across multiple packages, which we are trying to integrate as nicely as we can.
This is pretty common in the emacs world, and while it has its annoyances, there is value to it as well.
The practical question for this module documentation is what we should be responsible for documenting, and what should we defer to the packages we're using?
It's not really our fault if upstream package documentation is lacking. OTOH, we should certainly a) report gaps upstream, and b) look for places where we can provide a bridge.

Maybe implementing a dedicated keybinding layer would be sufficient to make discoverability easier.

You mean "dedicated" to Doom and this module, that supersede those in the packages we're using?
Can you give an example where this is currently a problem that we don't do this?

This might not be up to the task for the current PR but should be considered for the future.
I'd help with documenting if my skills suffice.
Some ideas about approaching this documentation:

What to do if drag-n-drop fails?
What if there is no DOI?
How to add entries manually
Whats a general workflow?
How to add notes to file?
How can org-noter be incorporated?
How to create an org-roam entry with cite links?

All are good and reasonable issues.
But per my points above, which of those are realistically our responsibility to document, and which should be reported upstream?

You mean "dedicated" to Doom and this module, that supersede those in the packages we're using?

Sorry, I worded this incorrectly. I meant a dedicated default keybinding prefix when using biblio, for example SPC-r(could also only be active on selected mode-maps like org or bibtex). This would then pack some useful commands behind it for getting started. In case someone knows their way around it can be overwritten by custom bindings. Admittedly, this approach might be beyond the philosophy of doom-emacs.

Can you give an example where this is currently a problem that we don't do this?

Does this get answered with my previous paragraph? If not, could you please rephrase this? Do you mean doom-emacs in general or specific changes in the current PR?

But per my points above, which of those are realistically our responsibility to document, and which should be reported upstream?

I admit that this a weak point and those questions might be more fitting on a blog or in doom-emacs/docs/ documentation. Most of it should be documented upstream. Still, doom provides a features section for some modules. Maybe one could think of adding some helpful tips there, but this is most likely outside the range of this PR.

I meant a dedicated default keybinding prefix when using biblio, for example SPC-r(could also only be active on selected mode-maps like org or bibtex). This would then pack some useful commands behind it for getting started. In case someone knows their way around it can be overwritten by custom bindings. Admittedly, this approach might be beyond the philosophy of doom-emacs.

It probably would, but @hlissner would be arbiter of that question.
You can always create your own keybindings to do this too.

Maybe one could think of adding some helpful tips there, but this is most likely outside the range of this PR.

Sure. Hopefully we can get this PR merged, and maybe that can be a latter step.
Feel free to collect of that info for possible inclusion.

rebased and bumped the pins

Hey, thanks a lot for extending the module tools: biblio. As LaTeX user it will be really handy.
Nevertheless, I really think that org-ref should be offered as an option with a flag.
It is a great package, but I think it does not integrate well with Doom philosophy.

It slowdowns the init time a lot.

The assumption currently is that if someone is using org, then we can
assume you want org-ref.
So you're saying that's not the case with you?
FWIW, I have no objection to adding that flag; just clarifying.

Yes, I am using ox-bibtex https://github.com/yyr/org-mode/blob/master/contrib/lisp/ox-bibtex.el

it is deferred so do not load on init, only when referenced. Also it uses ivy-bibtex if you have ivy enabled and not helm (https://github.com/hlissner/doom-emacs/pull/2888/commits/5f0edbca435e71dfbb3484ed7f49a1717c36b74a#diff-9535f000ae2e09e5c9700b6136569cc6R79), the overall package used to be  called helm-bibtex, but that has now been split into 3 packages (https://github.com/tmalsburg/helm-bibtex/commit/473761dffe956b5aa7d60d399d037ec7d80c69b8). ivy-bibtex, helm-bibtex and bibtex-completion. bibtex-completion is used by helm/ivy as the backend, but used to be included by requiring helm-bibtex. I can check if the reference has been changed in orf-ref.
AFAIK the "ox-" series of packages are used for exporting form org to some other format (https://orgmode.org/worg/exporters/ox-overview.html).
As regards to speed, I see no additional delays with init. I have these packages enabled and still get between 0.5 and 0.6 second times on init.
For pure latex enabled use cases reftex is included in the latex module under the +ref flag.
As for the doom philosophy, I can not really comment there. But what I can see is that it seems to about giving a reasonable set of defaults for the average user of a package, with the flexibility to modify those to your needs. So if org-ref is not the common citation mechanism used by org users I have no issue to flag it out. If, however, it is one or 2 folks, I would probably suggest to add the following to the documentation (package! org-ref :disable) for people to opt-out.

(package! org-ref :disable) seems a good option.
Just for clarifying, it is org-ref who loads helm.
The line  (setq org-ref-completion-library #'org-ref-ivy-cite) does not solve the problem.
I am referring to for now it is stuck in helm (actually, that is the main reason I do not use org-ref).

Org-roam just added tagging support, which can be used to type bibliographic notes, including (optionally) by placing them in a subdir.
https://org-roam.github.io/org-roam/manual/Tags.html#Tags

Sorry for the delay. As I'm very new to bibtex, org-roam and org-ref, reviewing this is taking me a while; digging through these packages. There are few pain points I'm trying to deal with:

The three defcustoms. If possible, I'd like to avoid introducing new variables, and am investigating a way around these; especially because we do not use defcustom anywhere else.
We have a lot of (unless X (setq X DEFAULTS)), and I'm going through each of their upstream defaults to see if these checks are warranted (or if we could simply define them in their respective defvars).
I don't fully understand the relationship between org-ref and bibtex-completion, and wonder why :after (org bibtex-completion) is necessary. This complicates the customization path for the user, because neither (after! org ...) nor (after! bibtex-completion ...) will be enough to configure the package (and due to use-package's :after semantics, any config in a user's (after! org-ref ...) will be overruled).

I'll keep you posted as I truck along.

Can we assess where we're at?
My understanding is that @brianmcgillion addressed 3 in a subsequent commit, and provided context for 1 and 2 in this comment.
So the question of those variables is the key thing we're stuck on ATM?

I ran into a problem with this module and (format +onsave).
Specifically, when (format +onsave) is set, dragging a pdf file onto an open bib file does not work correctly. Org-ref correctly looks up the reference information based on the doi and inserts it into the bib file. The file is then saved and autoformatted. This leaves the point in the wrong place for the remainder of org-ref's drag and drop handling, which leads to strange filenames, like nil.pdf and other weird problems. This is fixed by disabling (format +onsave).
I would suggest that either autoformating of bib files should be disabled if both the biblio module is loaded and +onsave is set, or that appropriate advice is added around org-ref functions to temporarily disable autosave.

Just a gentle bump, @hlissner, while I'm thinking about :-)
https://github.com/hlissner/doom-emacs/pull/2888#issuecomment-629780792

I've been testing this branch, and I'm no expert, so take this as you will, but I find that enabling this module causes everything org-related in Doom not to work, on my setup, at least. It complains: (wrong-type-argument stringp nil). I did toggle-debug-on-error and I got this traceback (truncated, but called from require(org) and so on.
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  directory-name-p(nil)
  (if (directory-name-p org-ref-notes-directory) (function org-ref-notes-function-many-files) (function org-ref-notes-function-one-file))
  (setq org-ref-notes-function (if (directory-name-p org-ref-notes-directory) (function org-ref-notes-function-many-files) (function org-ref-notes-function-one-file)))
  (if nil nil (setq org-ref-notes-function (if (directory-name-p org-ref-notes-directory) (function org-ref-notes-function-many-files) (function org-ref-notes-function-one-file))))
  (progn (require (quote org-ref) nil nil) (setq org-ref-open-pdf-function (quote org-ref-get-pdf-filename-helm-bibtex)) (if nil nil (setq org-ref-notes-function (if (directory-name-p org-ref-notes-directory) (function org-ref-notes-function-many-files) (function org-ref-notes-function-one-file)))) t)
  (closure (t) nil (progn (require (quote org-ref) nil nil) (setq org-ref-open-pdf-function (quote org-ref-get-pdf-filename-helm-bibtex)) (if nil nil (setq org-ref-notes-function (if (directory-name-p org-ref-notes-directory) (function org-ref-notes-function-many-files) (function org-ref-notes-function-one-file)))) t))()
  eval-after-load-helper("/home/jon/.emacs.doom.d/.local/straight/build/org-mode/org.elc")
  run-hook-with-args(eval-after-load-helper "/home/jon/.emacs.doom.d/.local/straight/build/org-mode/org.elc")
  do-after-load-evaluation("/home/jon/.emacs.doom.d/.local/straight/build/org-mode/org.elc")

What I'm guessing is happening is that this line calls (if (directory-name-p org-ref-notes-directory)), which on my system is nil, since I don't have one of these directories—I just use a single org-ref notes file.
My setup is pretty much just like the one in your config.el, with these lines:
(setq! +biblio-pdf-library-dir "~/Dropbox/Papers/"
       +biblio-default-bibliography-files '("~/Dropbox/Papers/library.bib")
       +biblio-notes-path "~/Dropbox/Org/Projects/books.org")

So I don't know what's going wrong.
But I do know that I can work around this by adding the line:
(setq! org-ref-notes-directory "")

right above my config lines from earlier. If my elisp-fu were better, I'd try to fix this, but alas, that's all I got. Hope this helps.

I just tested this out and was able to get everything working. I did end up with Warning (:warning): Bibtex-completion couldn't find entry with key "EvilreadthedocsioenlatestPdf". but I think this may be a user warning?

But I do know that I can work around this by adding the line:
(setq! org-ref-notes-directory "")

right above my config lines from earlier. If my elisp-fu were better, I'd try to fix this, but alas, that's all I got. Hope this helps.

Thanks @JonathanReeve, I think your deduction is spot on. directory-name-p does not seem to behave logically, i.e. nil in my understanding is not a directory name so should take the alternative path just like " " or "file", however, it is instead treated as an invalid parameter. I will look to fix that.

@brianmcgillion how's it going? Have you had any further time to look into this? I'm just a casual observes but it looks like this is 95% of the way there

An user of org-roam may use a one long file note using org-ref, so it would be a good idea that the module provides an independent flag (e.g. +roam-bibtex) for org-roam-bibtex.

I agree with that

Any updates about the org-ref and org-roam-bibtex integrations?

@helpotters I can't speak for the plan on a timeline for integration of it into doom, but it's working very well for me by just dropping the changes here into my private config. I think if more people can test the stability of the module in their work we can find any nagging issues.

I'm having an issue that I believe is related to the configuration. Occasionally I get an error when creating a new notes file.
if: Symbol’s function definition is void: pushnew

If it's solid enough to run for general testing, I'd be enthusiastic to
participate. Thank you for the suggestion and encouragement!

It's definitely solid enough for testing (and even merging probably).

I've been testing this branch, and I'm no expert, so take this as you will, but I find that enabling this module causes everything org-related in Doom not to work, on my setup, at least. It complains: (wrong-type-argument stringp nil). I did toggle-debug-on-error and I got this traceback (truncated, but called from require(org) and so on.

@JonathanReeve could you test, with some guidance from @Lejon the single file option should work. I tested a single org file without Roam enabled and it created the notes. If not please let me know!

If it's solid enough to run for general testing, I'd be enthusiastic to participate. Thank you for the suggestion and encouragement!

I use it on a daily basis. I just rebase ontop of doom/develop occasionally and it is working fine. Of course, I have my workflow and these tools allow many ways to achieve similar things, so I have not exhausted all config possibilities.

I've been using this successfully for some time now. Even started using org-roam, and org-roam-bibtex, as well. I haven't tested it with minimal or little config, but it works with my setup. :shipit:

Looking forward for this :+1:

I am looking forward to merging this pull request.

since hugo and ox-hugo are already integrated into doom, would be nice the addition of https://github.com/andras-simonyi/citeproc-org into biblio

since hugo and ox-hugo are already integrated into doom, and now with this org-ref, would be nice the addition of https://github.com/andras-simonyi/citeproc-org into biblio

That would be a good next step, but we first have to get this merged. It's now been more than eight months.

since hugo and ox-hugo are already integrated into doom, and now with this org-ref, would be nice the addition of https://github.com/andras-simonyi/citeproc-org into biblio

That would be a good next step, but we first have to get this merged. It's now been more than eight months.

That would be a good next step, but we first have to get this merged. It's now been more than eight months.

Sure thing! I've been using this PR for almost 11 days now and works great!

That would be a good next step, but we first have to get this merged. It's now been more than eight months.

Sure thing! I've been using this PR for almost 11 days now and works great!

Is anyone else seeing this?
Using ivy-bibtex, when I select a candidate, and do M-o to get the action menu, I just get a generic ivy menu; not the ivy-bibtex actions I'm expecting.

Is anyone else seeing this?
Using ivy-bibtex, when I select a candidate, and do M-o to get the action menu, I just get a generic ivy menu; not the ivy-bibtex actions I'm expecting.

@bdarcus I'm also seeing that generic ivy menu

Thanks @natejlong.
I don't ever recall seeing that before. Is that something new in ivy?

As we're still waiting to get this merged, I just thought I'd update on the discussions I've been involved in on this PR.
https://github.com/tmalsburg/helm-bibtex/pull/355
What's interesting about this is it proposes to adapt to bibtex-completion to make ivy/helm-bibtex-like functionality available in default Emacs completion, and hence also selectrum.
I think it would be straightforward to adapt here, for when there is a selectrum module merged.

Honestly it's the first time I've noticed it too! I was using helm-bibtex previously, not a big expert on helm or ivy to be honest.
I should've also mentioned I'm not using this PR exactly, so it might be a config/package version difference, but if there's anything I can do to help you out let me know
On Sun, Feb 7, 2021, at 13:43, bdarcus wrote:

As we're still waiting to get this merged, I just thought I'd update on the discussions I've been involved in on this PR.

tmalsburg/helm-bibtex#355 https://github.com/tmalsburg/helm-bibtex/pull/355

What's interesting about this is it proposes to adapt to bibtex-completion to make ivy/helm-bibtex-like functionality available in default Emacs completion, and hence also selectrum.

I think it would be straightforward to adapt here, for when there is a selectrum module merged.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/hlissner/doom-emacs/pull/2888#issuecomment-774730219, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYT37GSGB3XCPAQGAAEQM3S53NLTANCNFSM4MGFYSBA.

Honestly it's the first time I've noticed it too! I was using helm-bibtex previously, not a big expert on helm or ivy to be honest.

I think we want that keybinding to bypass that interim menu and go straight to the actions, but I'm not an expert either, so not sure.

As we wait on input from henrik, a bit of an update on the discussion I linked to above on adding support for completing-read/selectrum to bibtex-completion, as it has bearing on an initial decision on a module keybinding.
Both ivy-bibtex and helm-bibtex have their respective entry points, which brings up a search interface for a bibliography collection, and then one choose actions for the selected candidate(s).
But @minad made the, I think very good, suggestion to instead expose those actions as full interactive commands, so that the user can more directly do, for example M-x ivy-bibtex-insert-key.
Which brings me to this:
:desc "Bibliographic entries"        "b"
        (cond ((featurep! :completion ivy)   #'ivy-bibtex)
              ((featurep! :completion helm)  #'helm-bibtex)))

It strikes me that those commands really means "search bibliographic entries" (which is basically the docstring for these functions), and so I think ideally the binding should be "SPC n b s", and that perhaps later we can add additional commands to "SPC n b."

As for @hlissner, here's what he said on discord awhile back in response to a query from @bmg:

I have a couple design issues with the PR that I can't solve without more insight into how to use org-ref and org-roam-bibtex.

If this is the holdup ATM, it might give someone (@myshevchuk?) an idea of where to look, if they have the time and inclination.

Please take me off this thread since I’m not the right Leif Jonsson.
BR
-Leif Jonsson

On 21 Feb 2021, at 14:39, bdarcus<EMAIL_ADDRESS>wrote:
As for @hlissner https://github.com/hlissner, here's what he said on discord awhile back in response to a query from @BMG https://github.com/BMG:
I have a couple design issues with the PR that I can't solve without more insight into how to use org-ref and org-roam-bibtex.
If this is the holdup ATM, it might give someone (@myshevchuk https://github.com/myshevchuk?) an idea of where to look, if they have the time and inclination.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/hlissner/doom-emacs/pull/2888#issuecomment-782859797, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA664MYCSRYBS3IYPLEWFOTTAEEKVANCNFSM4MGFYSBA.

Can we do that?
You might just click the unsubscribe link at the bottom of the
notification email?

You’re right! I thought that was GitHub in general, but it was this specific thread!
Thanks!
Cheers!
-Leif

On 21 Feb 2021, at 15:51, bdarcus<EMAIL_ADDRESS>wrote:
Can we do that?
You might just click the unsubscribe link at the bottom of the
notification email?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/hlissner/doom-emacs/pull/2888#issuecomment-782870131, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA664M4LJMODVELDFRIK6SLTAEMXXANCNFSM4MGFYSBA.

Is anyone else seeing this?
Using ivy-bibtex, when I select a candidate, and do M-o to get the action menu, I just get a generic ivy menu; not the ivy-bibtex actions I'm expecting.

Seems a bug:
https://github.com/abo-abo/swiper/issues/2397

@bdarcus Hi, is there anything specific I could help with? I looked at the configuration code and most of it is now outdated. Also, ORB is still unstable and a few possibly breaking changes are expected.

@bdarcus Hi, is there anything specific I could help with? I looked at the configuration code and most of it is now outdated. Also, ORB is still unstable and a few possibly breaking changes are expected.

No, I was just wondering if you saw anything off that you thought might have caused the concern that @hlissner noted, but didn't really explain.
But what you say itself might itself suggest removing this for now.
Should we just do that and merge the other stuff, @brianmcgillion?

The module causes errors with vanilla config.el, which is something people don't expect to see. How about revising
https://github.com/brianmcgillion/doom-emacs/blob/6d61f98ef11c4fcdfd30135564a9290d7337ca27/modules/tools/biblio/config.el#L88-L93 as follows?
    (setq org-ref-notes-function #'org-ref-notes-function-one-file)
    (unless (null org-ref-notes-directory)
      (setq org-ref-notes-function (if (directory-name-p org-ref-notes-directory)
                                       #'org-ref-notes-function-many-files
                                     #'org-ref-notes-function-one-file)))

In case anyone is testing the new WIP selectrum PR, I've put together a PR for bibtex-completion that makes it compatible.

Update; now a separate package.
https://github.com/bdarcus/bibtex-actions

I'm a bit lost. Is there a new package just for ivy-bibtex/helm-bibtex compatability? kkkkkkkk

I'm a bit lost. Is there a new package just for ivy-bibtex/helm-bibtex compatability?

What are you referring to?
If the package I posted just above, the easiest way to think of it is it's like selectrum-bibtex (though will work with other completing-read-based completion systems).
If this PR, no; the module already has that; this is expanding the features.

The org-file for biblio is not very clear in how to setup or utilize the package.
For example, something as simple as inserting a citation from the default bibtex file.

The org-file for biblio is not very clear in how to setup or utilize the package.
For example, something as simple as inserting a citation from the default bibtex file.

It's been awhile (this PR was submitted almost a year ago at this point), but I think that's because these packages, and this module, provide a range of ways that could work.
Are you authoring in latex-mode, markdown-mode, or org-mode, for example?
Using primarily ivy-bibtex or helm-bibtex to insert the citations, or something else?
Aside: if the former, you open those commands, and insert the citation from there. But that's extensively documented at that project.
Do others have any views on this question; about the depth of what should be documented here?

I believe these should be, and are, set with the +biblio variables @brianmcgillion, so you can remove this part?

At the top of the section it states "It is of course possible to set the variables directly through their respective packages as shown below, in which case you can ignore the ~+biblio...~ versions.". So the instructions are there more for completeness if someone chooses that option.

For those of you interested in this, but not on the org list, after many years of stops and starts, org-cite (native org citation support) is set to be merged soon, and Bastien put out a call for testing today.
https://lists.gnu.org/archive/html/emacs-orgmode/2021-05/msg00003.html
So if you contribute to that, it will get it merged sooner rather than later.
If all goes smoothly, this should be merged for org 9.5.

For those of you interested in this, but not on the org list, after many years of stops and starts, org-cite (native org citation support) is set to be merged soon, and Bastien put out a call for testing today.

Thank you so much for linking this, I had no idea this was in the works. More importantly thank you @bdarcus for your work on the feature itself! I read through the thread there and the citation syntax looks like exactly what I've wanted in org. So excited to try this out

Does org-cite have any implications for the details of this package?
I'm wondering in particular about org-ref.
I do know it's author (John Kitchen) is hoping to rewrite that package to support it, but also that he doesn't have much time to do this, and has estimated it might take a year.
So not sure; maybe we should put that package behind a flag?

I'm definitely of the mind that adding citeproc would be a good idea :+1:
Also, I'd estimate the merge timeline to be of the order of weeks based on current progress.

I'm definitely of the mind that adding citeproc would be a good idea.

That, plus putting org-ref behind a flag, would seem the best way forward, giving users the most flexibility.
I don't, for example, use org-ref, and likely won't with org-cite. But I suspect others will use both.

based on a discussion with @bdarcus I have added +ref for inclusion of org-ref. Please add (org +ref) to your .doom.d/init.el

based on a discussion with @bdarcus I have added +ref for inclusion of org-ref. Please add (org +ref) to your .doom.d/init.el

Thanks @brianmcgillion!
FYI, I've learned a bit more about org-cite "follow" processors in the last 48 hours, after earlier not paying much attention to them.
The org-cite author describes them succinctly as "Follow is what happens when you use C-o on a citation."
In other words, it allows you to bind a function to org-open-at-point, to be able to run actions on either org citations or citation-references.
My plans for bibtex-actions, which will allow a kind of lightweight embarkified micro-org-ref:
https://github.com/bdarcus/bibtex-actions/issues/141
If and when John rewrites org-ref, I'd expect it to be just such a "follow" processor.

@brianmcgillion Hey! I have a few remarks on the PR:

I think the +ref flag makes more sense on the biblio module, since all the code that deals with it is in the biblio module, maybe as a +org-ref flag.
You might want to state more clearly in the readme that  org-ref installs both ivy and helm as dependencies, as users might wonder where the helm installation came from.
I think you forgot to update the existence of the +ref flag in the readme.
You might also want to introduce a doctor check that warns users if they have :tools biblio +org-ref on but not :lang org on, and maybe one that warns them against using org-ref if they are using a completion system that isn't ivy or helm since it seems that'll cause issues.

I just added the draft PR to add org-cite support https://github.com/hlissner/doom-emacs/pull/5212, to hopefully make it easier to align this and (maybe) #4664.

* You might want to state more clearly in the readme that  `org-ref` installs **both** `ivy` and `helm` as dependencies, as users might wonder where the helm installation came from.

A related issue: org-roam-bibtex currently requires org-ref, so has the same issue, though they intend to move to org-cite.
BTW, both org-roam and org-roam-bibtex are set for a major breaking change in a few days, to correspond with the release of org-roam v2.

Just by way of update, org-cite is now in org-mode master.

Just by way of update, org-cite is now in org-mode master.

I think this is ready for review.
https://github.com/hlissner/doom-emacs/pull/5212
@hlissner will ultimately have to decide the path forward.
I think it's no-brainer that org-cite becomes default when the org + biblio modules.
Less clear is what to do about this PR.
I have added a section to #5212 that addresses that, but to summarize here I see two options:

close this PR in favor of #5212, but add some of this there
close #5212 in favor of this, but merge that code here

Or I guess a third option is #5212 could add org-cite on top of this. This just might need to be adjusted to ensure that's easy to do.
1 is a cleaner path going forward, particularly with the new vertico module (org-ref, as discussed above, will install both ivy and helm even if you use vertico), while 2 provides more options.

Screencast demo of WIP org-cite version of org-ref.
https://www.youtube.com/watch?v=4ta4J20kpmM
I was already leaning towards removing org-ref from here, but this makes the case stronger.

Update, after talking to @brianmcgillion today.
We're going to drop org-ref from here, but I plan to (already have actually) add it's successor, org-ref-cite, to #5290.
The goal will be to merge that first, for Brian to rebase on that, and then this PR will just be about adding ORB.

@brianmcgillion so since #5290 got merged this can be reworked on top on that (and be merged finally :grimacing:)

will close this merge request. Will add org-roam-bibtex in https://github.com/hlissner/doom-emacs/pull/6077 and org-ref can be discussed for inclusion separately.


Warmstart via a different language

Hi,
Is it possible to use warmstart feature on a language other than English for faster convergence? Using LJSpeech pretrained model as a base, I like to know if we can get feasible results if we try to train a new model of a different speaker and a different language.
Best Regards.

Yes, check this one.

Thanks, @ksaidin ,
What if I want to train a new model for Spanish using English pretrained model as a base?

 It works even for russian language with its cyrillic letters. Make sure you are warm starting when training with English pretrained tacotron 2 model.

Thanks, I will try right away


JDK 11 test failures

No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
NoSuchElementException in BasicCertificateChainCleaner.clean
StreamReset stream was reset: PROT...

marked with TODO in the code

FWIW I split these out as there is value in having the tests in place even while existing bugs with JDK 11 remain.

@swankjesse Hey, just wanted to flag these.  They probably deserve some attention, but I may not get to them in next couple of weeks.  They pre-existed but were surfaced by the Jenkins matrix build.

I've just tried to run the testsuite with Java 11 (jdk-11.0.2.jdk) and got this failure:
[ERROR] Tests run: 32, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 77.672 s <<< FAILURE! - in okhttp3.InterceptorTest
[ERROR] connectTimeout(okhttp3.InterceptorTest)  Time elapsed: 75.613 s  <<< ERROR!
java.net.ConnectException: Operation timed out (Connection timed out)
	at okhttp3.InterceptorTest.connectTimeout(InterceptorTest.java:693)

Shall I create a separate issue for it, or shall we track failures in this issue? p.s. I can look into it.

I think fine here.
Sent with GitHawk

Apologies, issue was also happening with Java 8. Turns out the error only appears when wifi is disabled on my laptop (but ethernet on...). Shall I create a separate issue?

Went ahead and created #4682

Isolated one of ’em to a regression in OpenJDK caused by the pre_shared_key extension. https://github.com/square/okhttp/issues/4703


[Offline] Paypal account added without internet is saved, but when connect to internet it disappears - Reported by @thesahindia

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

Action Performed:

Set phone offline
Add Paypal.me
Set phone back online
Navigate back to check Paypal

Expected Result:
User settings should be saved and updated after user goes online
Actual Result:
Paypal account added without internet is saved, but when connect to internet it disappears
Workaround:
unknown.
Platform:

Where is this issue occurring?

Web
iOS
Android
Desktop App
Mobile Web

Version Number: 1.1.33-0
Reproducible in staging?: Y
Reproducible in production?: Y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
https://user-images.githubusercontent.com/43995119/151741316-ce0039ce-c9a5-4f85-a64f-728a4563b844.mov
Expensify/Expensify Issue URL:
Issue reported by: @thesahindia
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1642006938381400
View all open jobs on GitHub

Current assignee @michaelhaxhiu is eligible for the AutoAssignerTriage assigner, not assigning anyone new.

hold

Still hold

@thesahindia please apply for this upwork job, we are going to pay and close
https://www.upwork.com/jobs/~01bb74397ae6e0d160

Done 🚀

Done, closing.


Add More Architectures

Checklist

[x] Used a personal fork of the feedstock to propose changes
[x] Bumped the build number (if the version is unchanged): not needed, only new archs
[ ] Reset the build number to 0 (if the version changed)
[x] Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
[ ] Ensured the license file is being packaged.

Hi! This is the friendly automated conda-forge-linting service.
I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@conda-forge-admin, please rerender

@conda-forge-admin, please rerender


Reveal visible element width is not set correctly

Bug Report
The Reveal element works correctly when it is in a fixed section and left-aligned. However, if you put the Reveal into a floating element, then it doesn't work. For example, if you create a
 with textAlign: center, and put the Reveal elements inside that, you will see that the visible element does not display correctly. The hidden element exists in the center as expected from the div, but the visible element is still left-aligned.
When looking at the page rendered using Chrome dev-tools, I noticed that the width of the div created for the visible element is different from what's created for the hidden element. The hidden element successfully inherits the parent width, but the visible element does not.
Steps
View the sandbox that explains the issue here: https://codesandbox.io/s/stoic-haze-uwgt4.
The code is summarized below:
const styles1 = {
  textAlign: "center"
};

        <Reveal animated="fade">
          <Reveal.Content visible>
            <Image
              src="https://react.semantic-ui.com/images/wireframe/square-image.png"
              size="medium"
              centered
              circular
            />
          </Reveal.Content>
          <Reveal.Content hidden>
            <Image
              src="https://react.semantic-ui.com/images/avatar/large/ade.jpg"
              size="medium"
              centered
              circular
            />
          </Reveal.Content>
        </Reveal>

The above code works if you set width: "100%" for the <Reveal.Content visible> element.
Expected Result
The width of the visible and hidden element should be the same so that they are positioned behind one another when aligned in a floating div.
Actual Result
The width of the visible element is different from the hidden element and causes them to be positioned at different places instead of behind one another.
Version
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "semantic-ui-css": "^2.4.1",
    "semantic-ui-react": "^0.88.2"

Testcase
https://codesandbox.io/s/stoic-haze-uwgt4

After playing around with this a bit more I can see that this is a side-effect of the positioning of the elements. The visible element has absolute positioning from the following classes:

.ui.reveal>.visible.content {
    position: absolute!important;
    top: 0!important;
    left: 0!important;
    z-index: 3!important;
    transition: all .5s ease .1s;

This causes it to align to the left and top of the window, and it assumes the dimensions of it's children.
The hidden element, however, has relative positioning:

.ui.reveal>.hidden.content {
    position: relative!important;
    z-index: 2!important;
}

This causes it to take the shape and alignment as specified by the parent.
If I change the position of the hidden div to absolute, it left-aligns as well with the visible div. If I change the position of the visible div to relative, it then pushes the hidden div below it so that doesn't work either.
If I set the  width values of these elements as width: "100%", then that works for both the visible and hidden elements, and they are positioned correctly.

I should mention that the above workaround works fine for in-place animations like fade. But if you do something like rotate left, then it uses the entire width of the div and looks really weird!


Script Error Log

when i ran the script against DB i got the following error
Error:WaitStats.sql - Retrieving the COM class factory for component with CLSID {00000000-0000-0000-0000-000000000000} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
please advice

Hi,
The error suggests that Excel is not installed.  Could you please verify that Excel is installed on the machine from where you are running the health check?
Omid

Hi,
The error suggests that Excel is not installed.  Could you please verify that Excel is installed on the machine from where you are running the health check?
Omid

thanks Man for your support , the excel was corrupted so i reinstalled it & it works fine


Failed to convert quantization aware trained models.

Description of the bug:
I'm interested in converting quantization aware trained models. A simple test script that I'm using:
# Disable GPU for model conversion to tflite.
# Fix for https://github.com/google-ai-edge/ai-edge-torch/issues/326
# This may be removed when the issue is resolved.
# Without this fix, the training crashes with `Unknown PJRT_DEVICE 'CUDA'`.
import os
os.environ['PJRT_DEVICE'] = 'CPU'

from dataclasses import dataclass
from typing import Optional

import torch
import torchvision
import ai_edge_torch
from ai_edge_torch.quantize.quant_config import QuantConfig
from torch.ao.quantization.quantize_pt2e import convert_pt2e, prepare_qat_pt2e
from torch.ao.quantization.quantizer.xnnpack_quantizer import XNNPACKQuantizer, get_symmetric_quantization_config
from torch.ao.quantization.quantizer import QuantizationSpec

# Workaround for issue described in https://github.com/google-ai-edge/ai-edge-torch/issues/355
@dataclass(eq=True, frozen=True)
class QuantizationConfig:
    input_activation: Optional[QuantizationSpec]
    output_activation: Optional[QuantizationSpec]
    weight: Optional[QuantizationSpec]
    bias: Optional[QuantizationSpec]
    is_qat: bool = False

    # Add is_dynamic, since ai-edge-torch expects this attribute.
    is_dynamic: bool = False

example_inputs = (torch.randn(2, 3, 224, 224),)
model = torchvision.models.resnet18(torchvision.models.ResNet18_Weights.IMAGENET1K_V1)
model = torch.export.export_for_training(model, example_inputs).module()

quantizer = XNNPACKQuantizer().set_global(get_symmetric_quantization_config(is_qat=True))

# Workaround for error: `AttributeError: 'QuantizationConfig' object has no attribute 'is_dynamic'`.
quantizer.global_config = QuantizationConfig(
    input_activation=quantizer.global_config.input_activation,
    output_activation=quantizer.global_config.output_activation,
    weight=quantizer.global_config.weight,
    bias=quantizer.global_config.bias,
    is_qat=quantizer.global_config.is_qat,
    is_dynamic=False,
)

model = prepare_qat_pt2e(model, quantizer)
model = convert_pt2e(model)
torch.ao.quantization.move_exported_model_to_eval(model)

edge_model = ai_edge_torch.convert(model, example_inputs, quant_config=QuantConfig(pt2e_quantizer=quantizer))

However this fails to convert.
Actual vs expected behavior:
Instead of converting the model to tflite, I get the attached error log. I think the most interesting part of the error log is:

loc("<XLA_MLIR_DEBUGINFO_BEGIN>torch.fx.graph_module.GraphModule.new..GraphModuleImpl;<XLA_MLIR_DEBUGINFO_END>xla__dequantize_tensor"): error: 'mhlo.uniform_dequantize' op operand #0 must be ranked tensor of 2/4/8/16/32-bit uniform quantized signed integer or 2/4/8/16/32-bit uniform quantized unsigned integer or 2/4/8/16/32-bit uniform quantized per axis signed integer or 2/4/8/16/32-bit uniform quantized per axis unsigned integer values, but got 'tensor<64x3x7x7xi8>'

However I'm not sure what this means, or where this issue comes from.
log.txt
Any other information you'd like to share?
Running the same script without QAT does succeed:
# Disable GPU for model conversion to tflite.
# Fix for https://github.com/google-ai-edge/ai-edge-torch/issues/326
# This may be removed when the issue is resolved.
# Without this fix, the training crashes with `Unknown PJRT_DEVICE 'CUDA'`.
import os
os.environ['PJRT_DEVICE'] = 'CPU'

import ai_edge_torch
import torch
import torchvision

example_inputs = (torch.randn(2, 3, 224, 224),)
model = torchvision.models.resnet18(torchvision.models.ResNet18_Weights.IMAGENET1K_V1)

edge_model = ai_edge_torch.convert(model, example_inputs)

(this doesn't surprise me since the error seems to be related to data types)
Also post-training quantization seems to work:
# Disable GPU for model conversion to tflite.
# Fix for https://github.com/google-ai-edge/ai-edge-torch/issues/326
# This may be removed when the issue is resolved.
# Without this fix, the training crashes with `Unknown PJRT_DEVICE 'CUDA'`.
import os
os.environ['PJRT_DEVICE'] = 'CPU'

import ai_edge_torch
import torch
import torchvision
from torch.ao.quantization.quantize_pt2e import prepare_pt2e, convert_pt2e
from torch._export import capture_pre_autograd_graph

from ai_edge_torch.quantize.pt2e_quantizer import get_symmetric_quantization_config
from ai_edge_torch.quantize.pt2e_quantizer import PT2EQuantizer
from ai_edge_torch.quantize.quant_config import QuantConfig

sample_args = (torch.randn(2, 3, 224, 224),)
torch_model = torchvision.models.resnet18(torchvision.models.ResNet18_Weights.IMAGENET1K_V1)

pt2e_quantizer = PT2EQuantizer().set_global(
    get_symmetric_quantization_config(is_per_channel=True, is_dynamic=True)
)

pt2e_torch_model = capture_pre_autograd_graph(torch_model, sample_args)
pt2e_torch_model = prepare_pt2e(pt2e_torch_model, pt2e_quantizer)

# Run the prepared model with sample input data to ensure that internal observers are populated with correct values
pt2e_torch_model(*sample_args)

# Convert the prepared model to a quantized model
pt2e_torch_model = convert_pt2e(pt2e_torch_model, fold_quantize=False)

# Convert to an ai_edge_torch model
pt2e_drq_model = ai_edge_torch.convert(pt2e_torch_model, sample_args, quant_config=QuantConfig(pt2e_quantizer=pt2e_quantizer))

Attached is the requirements.txt of packages that I used when running the test script.
requirements.txt

Hi @hgaiser, thanks for raising the issue. I was able to replicate exactly as above.... I did notice this line in my exception and your log as well:
HLO -> MHLO conversion failed.
MHLO Module from HLO -> MHLO conversion is not legal.Please open a github issue to PyTorch/XLA.

In the stack trace we do make this call:
File "/home/hgaiser/issue/.venv/lib/python3.11/site-packages/torch_xla/core/xla_model.py", line 1103, in get_stablehlo_bytecode
    return torch_xla._XLAC._get_stablehlo(

So I think root cause is probably better serviced by that repo.

@pkgoogle thanks for your reply. I did see that error as well, but I assumed the root issue was the data type error. Do you think that this is not the root issue, but that the XLA error is?
If so: do you have a suggestion on how to make a proper issue on the pytorch/xla repo? What I mean is: I have zero experience with XLA so if I'd make an issue there it'd be along the lines of "I believe there might be something wrong, but I also have no idea what I'm talking about", which I know as a repo owner myself, isn't very useful information :)

@hgaiser, no worries -- it may be a data type error ... it's hard to say -- but I believe opening an issue with them will give us more information on what may be wrong, the exception is definitely happening in their code but if we somehow give them a malformed input or we are not fulfilling that contract correctly so to speak then the root issue may be with us, but I believe if you give them the information here they'll be able to say one way or the other. You can try just giving them the same code and give them installation instructions as well so that it is more easily reproducible for them, or you can manually unroll the stack and go through the code here (but since you know the specific way this code will go through the code you don't have to include every branch) to make a reproducible example which is independent of this repo. You can also compress some things since as you go through there's a lot of variable passing which you don't need to do if you unroll it.

Thanks for the tips @pkgoogle ! I found the following issues: https://github.com/pytorch/xla/issues/6567
That seems to be the same problem. I added fold_quantize=False to convert_pt2e and now it can convert. I can't say for sure everything works yet, but at least it doesn't crash at the moment :).
This is the modified (working) version of the above script:
# Disable GPU for model conversion to tflite.
# Fix for https://github.com/google-ai-edge/ai-edge-torch/issues/326
# This may be removed when the issue is resolved.
# Without this fix, the training crashes with `Unknown PJRT_DEVICE 'CUDA'`.
import os
os.environ['PJRT_DEVICE'] = 'CPU'

from dataclasses import dataclass
from typing import Optional

import torch
import torchvision
import ai_edge_torch
from ai_edge_torch.quantize.quant_config import QuantConfig
from torch.ao.quantization.quantize_pt2e import convert_pt2e, prepare_qat_pt2e
from torch.ao.quantization.quantizer.xnnpack_quantizer import XNNPACKQuantizer, get_symmetric_quantization_config
from torch.ao.quantization.quantizer import QuantizationSpec

# Workaround for issue described in https://github.com/google-ai-edge/ai-edge-torch/issues/355
@dataclass(eq=True, frozen=True)
class QuantizationConfig:
    input_activation: Optional[QuantizationSpec]
    output_activation: Optional[QuantizationSpec]
    weight: Optional[QuantizationSpec]
    bias: Optional[QuantizationSpec]
    is_qat: bool = False

    # Add is_dynamic, since ai-edge-torch expects this attribute.
    is_dynamic: bool = False

example_inputs = (torch.randn(2, 3, 224, 224),)
model = torchvision.models.resnet18(torchvision.models.ResNet18_Weights.IMAGENET1K_V1)
model = torch.export.export_for_training(model, example_inputs).module()

quantizer = XNNPACKQuantizer().set_global(get_symmetric_quantization_config(is_qat=True))

# Workaround for error: `AttributeError: 'QuantizationConfig' object has no attribute 'is_dynamic'`.
quantizer.global_config = QuantizationConfig(
    input_activation=quantizer.global_config.input_activation,
    output_activation=quantizer.global_config.output_activation,
    weight=quantizer.global_config.weight,
    bias=quantizer.global_config.bias,
    is_qat=quantizer.global_config.is_qat,
    is_dynamic=False,
)

model = prepare_qat_pt2e(model, quantizer)
model = convert_pt2e(model, fold_quantize=False)
torch.ao.quantization.move_exported_model_to_eval(model)

edge_model = ai_edge_torch.convert(model, example_inputs, quant_config=QuantConfig(pt2e_quantizer=quantizer))


Feedback for “@premieroctet/next-admin”

Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used

A server/client branch if (typeof window !== 'undefined').
Variable input such as Date.now() or Math.random() which changes each time it's called.
Date formatting in a user's locale which doesn't match the server.
External changing data without sending a snapshot of it along with the HTML.
Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.
See more info here: https://nextjs.org/docs/messages/react-hydration-error

className="dark"
style={{color-scheme:"dark"}}  can you tell the solution for it

Hello @ak-fe-rottengrapes
Are you encountering those issues ? Can you please elaborate about which page you get the issues on ?
If you have a date formatting issue related to hydration, make sure to check the example app where we have a field that is formatted depending on the user's locale

I just got this exact error @foyarash
I'm using<EMAIL_ADDRESS>I modified the AdminPage page handler slightly as I got errors as params and searchParams now require awaiting (see https://nextjs.org/docs/app/building-your-application/upgrading/version-15#asynchronous-page)
import { NextAdmin, PageProps } from "@premieroctet/next-admin";
import { getNextAdminProps } from "@premieroctet/next-admin/appRouter";
import prisma from "../../../prisma";
import "../../../nextAdminCss.css";
import options from "../../../nextAdminOptions";

type Params = Promise<{ slug: string }>
type SearchParams = Promise<{ [key: string]: string | string[] | undefined }>

export default async function AdminPage({
  params,
  searchParams
}: { params: Params, searchParams: SearchParams }) {

  const props = await getNextAdminProps({
    params: (await params).slug,
    searchParams: await searchParams,
    basePath: "/admin",
    apiBasePath: "/api/admin",
    prisma,
    options
  });

  return <NextAdmin {...props} />;
}

When I navigate to admin route, I am automatically redirected to /admin/player but the page reloads it's over and over and is stuck in a loop.
Clicking the error link, I get the same error shown in the OP.
Any ideas?

Exact same issue as @garrytrinder , upon navigating to the admin route, it takes me to admin/user, as I have configured, but it keeps reloading the page. The error is the same as above:
A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:

- A server/client branch `if (typeof window !== 'undefined')`.
- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

https://react.dev/link/hydration-mismatch

Update: After downgrading react and react-router-dom from 19.0.0 to 18.2.0, as well as next to 14.2.0, it seems to work. This is not a good longterm solution, because it seems as if next-admin is incompatible with react 19.0.0.

Update: After downgrading react and react-router-dom from 19.0.0 to 18.2.0, as well as next to 14.2.0, it seems to work. This is not a good longterm solution, because it seems as if next-admin is incompatible with react 19.0.0.

Thank for solutions
Also for version control it's pretty easy I don't why they didn't solved it

Hello, so I've been trying to run the example app with the combination of Next 15 and React 19, went to the /admin, removed the dashboard so that I am redirected automatically to /admin/user and I did not encounter any of your issues.
This leads me to think that there might be some specific stuff that might be in your model's configuration that I might be missing.
Would that be possible that you share the model's options ?
Thank you

Could you let me know if 7.0.2 fixes it ?

Currently my exam are going on. Once they are finished I will give you all
things you need
Also I get this error when I try to post some or try to get some data
I will give detailed information after my exam
On Wed, 11 Dec, 2024, 10:35 pm Hugo FOYART, @.***>
wrote:

Could you let me know if 7.0.2 fixes it ?
—
Reply to this email directly, view it on GitHub
https://github.com/premieroctet/next-admin/issues/492#issuecomment-2536572498,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/BLKHABCFUCDRVHJFIDIDNOL2FBWFPAVCNFSM6AAAAABSWUUY22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZWGU3TENBZHA
.
You are receiving this because you were mentioned.Message ID:
@.***>

Also if possible can you add the support for the GIS
I should be able to see the map I have uploaded the geolocation in database

Could you please open a new issue for this ? Thank you

Hi @foyarash,
at least on my side, the issue persists with version 7.0.2, exactly the same setup as @garrytrinder.
Error message:

- A server/client branch `if (typeof window !== 'undefined')`.
- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

See more info here: https://nextjs.org/docs/messages/react-hydration-error

- style={{color-scheme:"dark"}}
- className="dark"

I am using next.js 15.0.3 and next-admin 7.0.2

Hi @foyarash,
at least on my side, the issue persists with version 7.0.2, exactly the same setup as @garrytrinder.
Error message:
Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used

- A server/client branch `if (typeof window !== 'undefined')`.
- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

See more info here: https://nextjs.org/docs/messages/react-hydration-error

- style={{color-scheme:"dark"}}
- className="dark"

I am using next.js 15.0.3 and next-admin 7.0.2

This is so weird...
Could you please send the following:

options for the affected model
prisma schema of the affected model

Thank you

Thanks for the quick reply!
I am using almost default values, and it's happening with a very simple model:
My nextAdminOptions.tsx:
import type { NextAdminOptions } from "@premieroctet/next-admin";

const options: NextAdminOptions = {
  title: "My awesome admin",

  model: {},
};

export default options;

My tailwind.admin.config.ts:
import { Config } from "tailwindcss";

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    "node_modules@premieroctet/next-admindist/**/*.{js,ts,jsx,tsx}",
    "./nextAdminOptions.{js,ts,jsx,tsx}",
  ],
  darkMode: "class",
  theme: {},
  presets: [require("@premieroctet/next-admin/preset")],
} satisfies Config;

My page.tsx:
import { NextAdmin, PageProps } from "@premieroctet/next-admin";
import { getNextAdminProps } from "@premieroctet/next-admin/appRouter";
import prisma from "@/db/prisma";
import "../../../../nextAdminCss.css";
import options from "../../../../../../nextAdminOptions";

export default async function AdminPage({ params, searchParams }: PageProps) {
  const { nextAdmin } = await params;
  const search = await searchParams;
  const props = await getNextAdminProps({
    params: nextAdmin,
    searchParams: search,
    basePath: "/admin",
    apiBasePath: "/api/admin",
    prisma,
    options,
  });

  return <NextAdmin {...props} />;
}

My route.ts:
import prisma from "@/db/prisma";
import { createHandler } from "@premieroctet/next-admin/appHandler";
import options from "../../../../../nextAdminOptions";
import { bypassRLS } from "@/db/extensions";
import validateAuthenticated from "@/lib/auth/validate-authenticated";
import validateHasRole from "@/lib/auth/validate-has-role";

const { run } = createHandler({
  apiBasePath: "/api/admin",
  prisma: prisma.$extends(bypassRLS()),
  onRequest: async () => {
    await validateAuthenticated();
    await validateHasRole("global_admin");
  },
  options,
});

export { run as DELETE, run as GET, run as POST };

Prisma schema of one of the models:
model User {
  id             String        @id @default(uuid()) @db.Uuid
  createdAt      DateTime      @default(now())
  updatedAt      DateTime      @updatedAt
  firstName      String
  lastName       String
  email          String        @unique
  organization   Organization? @relation(fields: [organizationId], references: [id])
  organizationId String?       @db.Uuid
}

Given the error message, I suspect it has something to do with how the darkmode info is stored on the HTML?
This is the expanded info:

Thanks a lot, I'll have a look at it

Sorry few more questions:

are you having this issue on every models ?
is it occuring only on the list ? do you have the issue going on /admin/user/new for example ?
do you have a layout as a sibling file of the page ?

This is so strange because there is no place where we apply those attributes

Yes, it's happening on every model even though i always get redirected to /user even when navigating to /admin/organization so i can't really say.
When navigating to /new for any of the models, I also get redirected to /user and then the same error occurs.
Not directly as a sibling but there was one layout from a parent folder that was applied. I tried moving the page directly to the /app directory (which only has the default layout.tsx from next.js, with the same error.

Could you try to set "next-themes": "^0.4.4" in your package.json's resolutions, install your packages and retry ?

Just tried it, unfortunately it's the same issue.
Not sure if this is relevant but I'm also getting this error the first time I run a clean build (second time goes through without error):
Warning: You're using `next/head` inside the `app` directory, please migrate to the Metadata API. See https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration#step-3-migrating-nexthead for more details.

warn - No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.
warn - https://tailwindcss.com/docs/content-configuration
 ⨯ ./src/app/globals.css:1:1
Syntax error: src\app\globals.css The `border-border` class does not exist. If `border-border` is a custom class, make sure it is defined within a `@layer` directive.

> 1 | @tailwind base;
    | ^
  2 | @tailwind components;
  3 | @tailwind utilities;
<w> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|node_modules\next\dist\build\webpack\loaders\css-loader\src\index.js??ruleSet[1].rules[13].oneOf[10].use[2]!node_modules\next\dist\build\webpack\loaders\postcss-loader\src\index.js??ruleSet[1].rules[13].oneOf[10].use[3]!src\app\globals.css': No serializer registered for PostCSSSyntaxError
<w> while serializing webpack/lib/cache/PackFileCacheStrategy.PackContentItems -> webpack/lib/NormalModule -> webpack/lib/ModuleBuildError -> PostCSSSyntaxError
 GET /admin 500 in 27441ms
 ⨯ ./src/app/globals.css:1:1
src\app\globals.css The `border-border` class does not exist. If `border-border` is a custom class, make sure it is defined within a `@layer` directive.

Are you using nextjs 15
On Fri, 13 Dec, 2024, 9:07 pm Marian Lambert, @.***>
wrote:

Just tried it, unfortunately it's the same issue.
Not sure if this is relevant but I'm also getting this error the first
time I run a clean build (second time goes through without error):
Warning: You're using next/head inside the app directory, please migrate to the Metadata API. See https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration#step-3-migrating-nexthead for more details.
warn - No utility classes were detected in your source files. If this is unexpected, double-check the content option in your Tailwind CSS configuration.
warn - https://tailwindcss.com/docs/content-configuration
⨯ ./src/app/globals.css:1:1
Syntax error: src\app\globals.css The border-border class does not exist. If border-border is a custom class, make sure it is defined within a @.***` directive.

1 | @tailwind base;
| ^
2 | @tailwind components;
3 | @tailwind utilities;
 [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|node_modules\next\dist\build\webpack\loaders\css-loader\src\index.js??ruleSet[1].rules[13].oneOf[10].use[2]!node_modules\next\dist\build\webpack\loaders\postcss-loader\src\index.js??ruleSet[1].rules[13].oneOf[10].use[3]!src\app\globals.css': No serializer registered for PostCSSSyntaxError
 while serializing webpack/lib/cache/PackFileCacheStrategy.PackContentItems -> webpack/lib/NormalModule -> webpack/lib/ModuleBuildError -> PostCSSSyntaxError
GET /admin 500 in 27441ms
⨯ ./src/app/globals.css:1:1
src\app\globals.css The border-border class does not exist. If border-border is a custom class, make sure it is defined within a @.***` directive.

—
Reply to this email directly, view it on GitHub
https://github.com/premieroctet/next-admin/issues/492#issuecomment-2541719779,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/BLKHABG3BL26YHFA2V5HZGL2FL5M7AVCNFSM6AAAAABSWUUY22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBRG4YTSNZXHE
.
You are receiving this because you were mentioned.Message ID:
@.***>

@ak-fe-rottengrapes yes, next.js 15.0.3

@mlxyz just notices you forgot some slashes in your tailwind config's content for the next-admin files, but i dont know if that will fix your issue

Ok I was able to reproduce on a brand new clean Next 15 project. i'll investigate from there

Oh my god I feel so stupid...
You need to add suppressHydrationWarning to your root <html> tag per the next-themes documentation
I will definitely add this in the docs

Got it working!

First I upgraded to next.js 15.1.0: this fixed the infite loop
Then I added suppressHydrationWarning to my html tag: this fixed the hydration warning
Then i fixed the slashes in my tailwind.admin.config.ts (the missing slashes are also a bug, maybe due to windows backslashes?): this fixed the CSS issues

Now everything is working.
Great support and great library, thanks!

Good to know, that was a tricky one !
Thanks for all the details you gave in your previous posts

Solved

Are you sure adding suppresshydrationwarning actually fixes the issue? To me it's just a workaround to hide the warnings instead of fixing the origin of the problem.


Add workflow for GitHub release builds

Merry Christmas 🎄❄
This PR adds a workflow that does the following each time a versioned tag is created:

Ensures the tag matches the uiua crate version
Creates a release and pulls the respective changelog.md section as the description
Builds and uploads binaries for multiple targets[^1] on the release

If you also wanted this to work for cargo publish, let me know the details of what goes into manually publishing a version.
[^1]: This PR adds builds for the following targets: x86_64-apple-darwin, aarch64-apple-darwin, x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl, x86_64-pc-windows-msvc, aarch64-pc-windows-msvc

Awesome, thanks!


Azure Entra ID / Safari Browser: Access Denied / named cookie not present

Current Behavior
I'm trying to set up integration with Entra ID, but unfortunately I do not get the whole chain working. I get an Access Denied error in my browser after successfully logging into Azure, which is coming from the openvpn-auth-oauth2 component as it seems.
client.conf
client
proto udp
explicit-exit-notify
remote <domainname> 1194
dev tun
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
verify-x509-name server_2gxU7CObCpLBg6IL name
auth SHA256
auth-nocache
cipher AES-128-GCM
tls-client
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
ignore-unknown-option block-outside-dns
setenv opt block-outside-dns # Prevent Windows 10 DNS leak
verb 3
<ca>
-----BEGIN CERTIFICATE-----
xxx
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
xxx
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
xxx
-----END PRIVATE KEY-----
</key>
<tls-crypt>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
xxx
-----END OpenVPN Static key V1-----
</tls-crypt>
auth-user-pass
# Not sure if auth-user-pass is necessary, I get no browser popup without this (just hangs), saw it used in another ticket

server.conf
port 1194
proto udp
dev tun
user nobody
group nogroup
persist-key
persist-tun
keepalive 10 120
topology subnet
server <IP_ADDRESS> <IP_ADDRESS>
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS <IP_ADDRESS>"
push "dhcp-option DNS <IP_ADDRESS>"
push "redirect-gateway def1 bypass-dhcp"
dh none
ecdh-curve prime256v1
tls-crypt tls-crypt.key
crl-verify crl.pem
ca ca.crt
cert server_2gxU7CObCpLBg6IL.crt
key server_2gxU7CObCpLBg6IL.key
auth SHA256
cipher AES-128-GCM
ncp-ciphers AES-128-GCM
tls-server
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
client-config-dir /etc/openvpn/ccd
status /var/log/openvpn/status.log
verb 3
# verify-client-cert optional
management /run/openvpn/server.sock unix /etc/openvpn/password.txt
management-client-auth

/etc/sysconfig/openvpn-auth-oauth2
CONFIG_OPENVPN_ADDR=unix:///run/openvpn/server.sock
CONFIG_OPENVPN_PASSWORD=<password>
CONFIG_OAUTH2_ISSUER=https://login.microsoftonline.com/<tenant_id>/v2.0
CONFIG_OAUTH2_CLIENT_ID=<client_id>
CONFIG_OAUTH2_CLIENT_SECRET=<client_secret>
CONFIG_HTTP_LISTEN=:9000
# Define a random value with 16 or 24 characters
CONFIG_HTTP_SECRET=1jd93h5b6s82lf03jh5b2hf3
# Define the public http endpoint here.
CONFIG_HTTP_BASEURL=https://<domainname>:9000
CONFIG_HTTP_TLS=true
CONFIG_HTTP_KEY=/etc/sysconfig/server.key
CONFIG_HTTP_CERT=/etc/sysconfig/server.crt
CONFIG_OAUTH2_REFRESH_ENABLED=true
CONFIG_OAUTH2_REFRESH_EXPIRES=8h
CONFIG_OAUTH2_REFRESH_SECRET=<random_secret | I got an error that this value was missing, could not find it in the docs>

journalctl for ovpn
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 VERIFY OK: depth=1, CN=cn_y17JhGwUdyb1QJrr
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 VERIFY OK: depth=0, CN=default
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 peer info: IV_VER=3.8.1
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 peer info: IV_PLAT=mac
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 peer info: IV_NCP=2
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 peer info: IV_TCPNL=1
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 peer info: IV_PROTO=990
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 peer info: IV_MTU=1600
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 peer info: IV_CIPHERS=AES-128-CBC:AES-192-CBC:AES-256-CBC:AES-128-GCM:AES-192-GCM:AES-256-GCM:CHACHA20-POLY1305
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 peer info: IV_GUI_VER=OCmacOS_3.4.4-4629
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 peer info: IV_SSO=webauth,openurl,crtext
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 TLS: Username/Password authentication deferred for username 'test'
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 TLS: move_session: dest=TM_ACTIVE src=TM_INITIAL reinit_src=1
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 TLS: tls_multi_process: initial untrusted session promoted to semi-trusted
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: MANAGEMENT: CMD 'client-pending-auth 11 1 "WEB_AUTH::https://<domainname>:9000/oauth2/start?state=-6oVDgqXTVQq9ycDfralmAlFYs26rzbuFbZbad8wVe5-S1cT0xR6sBkC3Guc>
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: SENT CONTROL [default]: 'AUTH_PENDING,timeout 180' (status=1)
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: SENT CONTROL [default]: 'INFO_PRE,WEB_AUTH::https://<domainname>:9000/oauth2/start?state=-6oVDgqXTVQq9ycDfralmAlFYs26rzbuFbZbad8wVe5-S1cT0xR6sBkC3Guc1d6XQFPSZ>
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, peer certificate: 256 bits ECprime256v1, signature: ecdsa-with-SHA256, peer temporary key: 253 >
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 [default] Peer Connection Initiated with [AF_INET]<client_ip>:62496
Jan 03 20:08:43 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 PUSH: Received control message: 'PUSH_REQUEST'
Jan 03 20:08:44 shared-hub-vpn-gateway ovpn-server[614865]: <client_ip>:62496 PUSH: Received control message: 'PUSH_REQUEST'

journalctl for your component:
Jan 03 20:08:43 shared-hub-vpn-gateway openvpn-auth-oauth2[615049]: time=2024-01-03T20:08:43.863Z level=INFO msg="new client connection" cid=11 kid=1 reason=CONNECT common_name=default username=<username>
Jan 03 20:08:43 shared-hub-vpn-gateway openvpn-auth-oauth2[615049]: time=2024-01-03T20:08:43.863Z level=INFO msg="start pending auth" cid=11 kid=1 reason=CONNECT common_name=default username=<username>
Jan 03 20:08:44 shared-hub-vpn-gateway openvpn-auth-oauth2[615049]: time=2024-01-03T20:08:44.198Z level=INFO msg="initialize authorization via oauth2" common_name=default cid=11 kid=1
Jan 03 20:08:44 shared-hub-vpn-gateway openvpn-auth-oauth2[615049]: time=2024-01-03T20:08:44.509Z level=WARN msg="Unauthorized: failed to get state: http: named cookie not present"

Expected Behavior
No response
Steps To Reproduce
No response
Environment

openvpn-auth-oauth2 Version: 1.13.0
OpenVPN Server Version: OpenVPN 2.6.8 x86_64-pc-linux-gnu
Server OS: Ubuntu 22.04.3 LTS
OpenVPN Client (flavor, OS): OpenVPN Connect Version 3.4.4 (4629) on MacOS

Anything else?
No response

Thanks for your quick response. I wouldn't think my browser is the issue. I work with all kinds of OAuth/SAML/OIDC apps all day and they work fine. Anything I can do to further debug this issue? Or do you have a full reference config (server and client) for Azure that works on your end?

Or do you have a full reference config

The OpenVPN configuration is not related to this error. The openvpn-auth-oauth2 configuration is close to mine including TLS, expect I'm running with debug log level on my local machine.
Error messages says that it a specific cookie is missing. The cookie will be set on /oauth2/start then, redirect to Azure, and on callback URL, the cookie is requested again.
One error could be, if the hostname of /oauth2/start is different after redirect from Azure.
Ref: https://github.com/zitadel/oidc/issues/331

Debugging this issue is a bit hard. At least here is a step by step guide to debug the cookie handling on the browser.
I assume, you are using a Chrome based Browser.

Before connect to OpenVPN server, open a browser locally. On the new tab page, do right click, inspect. The browser console appears. Important: click on Network tab and ensure that "preserve log" is enabled.

Ideally, you not logged on Azure with you main browser, otherwise you are not intercept the flow.

Ensure, you have access to OpenVPN server logs on real-time. Tip: If you are using journalctl, use the option --no-pager. This prevent that large links are truncated.

Initiate connection to OpenVPN server, close the browser opened by OpenVPN client.

Goto OpenVPN server logs, grab the line with INFO_PRE,WEB_AUTH and copy the link with the full state.

Paste the link on the tab where the browser console in opened.

Continue the auth flow.

On the access denied screen, check the Browser Console for any errors.

Then goto the Network tab again. There is a request with /oauth2/start. Click on Cookies and check, if response cookie are present.
Example Screenshot:

Then goto the Network tab again. There is a request with /oauth2/callback. Click on Cookies and check, if request cookie are present.
Example Screenshot:

So the weirdest thing happened. I followed your procedure using Safari, but in step 6, I could not find the /oauth2/start request, even though that was the original request. So, I tried Chrome. Which worked, straight away. Not a single issue.
I tried again in Safari multiple times, logging out from single Azure account, in incognito mode, Access Denied every single time. Copying the same url from the logs, using it in Safari first: Access Denied, same url in chrome: Access granted.
As it turned out in Safari the request is hidden under authorize. These are the cookies I see:

As for step 7: here there are no cookies at all...
==
Unrelated question: can you confirm auth-user-pass is necessary? The credentials I enter there are not used (if I enter test:test and use Chrome, the VPN connection gets created). But if I remove auth-user-pass the browser screen is not coming up. I see you use auth-user-pass-optional on the server side in one of your tests, is that related?

As it turned out in Safari the request is hidden under authorize. These are the cookies I see:

It's not correct. authorize is the OIDC endpoint of azure and of course, the openvpn-auth-oauth2 will be not sent to Azure.
And I'm able reproduce the issue with Safari browser.

Unrelated question

On my tests, I used auth-user-pass and auth-user-pass-optional to play with auth-token features of OpenVPN which is replaced by builtin session refresh mechanism.
No, its not necessary and can be omit. Only
management /run/openvpn/server.sock unix /etc/openvpn/password.txt
management-client-auth

is mandatory and relates to openvpn-auth-oauth2.

And I'm able reproduce the issue with Safari browser.
Do you expect this can be fixed in your module?

Unrelated question
What about the auth-user-pass in the client config? Without it, my browser does not open. With it, OpenVPN Connect on Mac shows a popup to enter the (required) credentials but they are not actually used (anything works)

Time for bed :)

Do you expect this can be fixed in your module?

Yeah, turns out that I set a invalid path on the cookies. Instead /oauth2, I set oauth2 which is not conform, but interpreted correctly from Chrome browsers.
This is my client config:
client
dev tun
nobind
remote <IP_ADDRESS> 1194 udp4
remote-cert-tls server
resolv-retry infinite
tls-cert-profile preferred
persist-tun
verb 9
reneg-sec 0
<key>
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
</key>
<cert>
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
</cert>
<ca>
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
</ca>

That I use for local testing. Works with OpenVPN 2 based clients and OpenVPN 3 Connect. If you have auth-user-pass-optional or omit auth-user-pass on server, then nothing should ask for credentials.

Thanks a lot for your quick action!

If you have auth-user-pass-optional or omit auth-user-pass on server, then nothing should ask for credentials.

Both those options, lead to a spinning connection wheel, but no browser being opened. Nothing seems wrong on the server side, except that the MANAGEMENT and SENT CONTROL logs are not there anymore.
Client logs:
[Jan 4, 2024, 02:16:30] OpenVPN core 3.8.1 mac arm64 64-bit built on Aug 23 2023 04:35:28
[Jan 4, 2024, 02:16:30] Frame=512/2112/512 mssfix-ctrl=1250
[Jan 4, 2024, 02:16:30] NOTE: This configuration contains options that were not used:
[Jan 4, 2024, 02:16:30] Ignored by option 'ignore-unknown-option'
[Jan 4, 2024, 02:16:30] 18 [block-outside-dns]
[Jan 4, 2024, 02:16:30] Unsupported option (ignored)
[Jan 4, 2024, 02:16:30] 2 [explicit-exit-notify]
[Jan 4, 2024, 02:16:30] 5 [resolv-retry] [infinite]
[Jan 4, 2024, 02:16:30] 7 [persist-key]
[Jan 4, 2024, 02:16:30] 8 [persist-tun]
[Jan 4, 2024, 02:16:30] 12 [auth-nocache]
[Jan 4, 2024, 02:16:30] EVENT: RESOLVE
[Jan 4, 2024, 02:16:30] Contacting <server_ip>:1194 via UDP
[Jan 4, 2024, 02:16:30] EVENT: WAIT
[Jan 4, 2024, 02:16:30] UnixCommandAgent: transmitting bypass route to /var/run/agent_ovpnconnect.sock
{
	"host" : "<server_ip>",
	"ipv6" : false,
	"pid" : 95527
}

[Jan 4, 2024, 02:16:30] Connecting to [<domain>]:1194 (<server_ip>) via UDP
[Jan 4, 2024, 02:16:30] EVENT: CONNECTING
[Jan 4, 2024, 02:16:30] Tunnel Options:V4,dev-type tun,link-mtu 1521,tun-mtu 1500,proto UDPv4,cipher AES-128-GCM,auth [null-digest],keysize 128,key-method 2,tls-client
[Jan 4, 2024, 02:16:30] Creds: UsernameEmpty/PasswordEmpty
[Jan 4, 2024, 02:16:30] Peer Info:
IV_VER=3.8.1
IV_PLAT=mac
IV_NCP=2
IV_TCPNL=1
IV_PROTO=990
IV_MTU=1600
IV_CIPHERS=AES-128-CBC:AES-192-CBC:AES-256-CBC:AES-128-GCM:AES-192-GCM:AES-256-GCM:CHACHA20-POLY1305
IV_AUTO_SESS=1
IV_GUI_VER=OCmacOS_3.4.4-4629
IV_SSO=webauth,openurl,crtext

[Jan 4, 2024, 02:16:31] SSL Handshake: peer certificate: CN=server_2gxU7CObCpLBg6IL, 256 bit EC, group:prime256v1, cipher: TLS_AES_256_GCM_SHA384         TLSv1.3 Kx=any      Au=any   Enc=AESGCM(256)            Mac=AEAD

[Jan 4, 2024, 02:16:31] Session is ACTIVE
[Jan 4, 2024, 02:16:31] EVENT: GET_CONFIG
[Jan 4, 2024, 02:16:31] Sending PUSH_REQUEST to server...
[Jan 4, 2024, 02:16:32] Sending PUSH_REQUEST to server...
[Jan 4, 2024, 02:16:34] Sending PUSH_REQUEST to server...
[Jan 4, 2024, 02:16:35] Raw stats on disconnect:
 BYTES_IN : 2449
 BYTES_OUT : 3059
 PACKETS_IN : 8
 PACKETS_OUT : 11

[Jan 4, 2024, 02:16:35] Performance stats on disconnect:
  CPU usage (microseconds): 65867289
  Network bytes per CPU second: 83
  Tunnel bytes per CPU second: 0
[Jan 4, 2024, 02:16:35] EVENT: DISCONNECTED

Forget about my last post. Just tested your latest release and it works without credentials, in Safari! I'm really happy, thanks again!

Sorry that I comment on the closed issue, but I am experiencing same with chrome browser.
Logs from openvpn-auth-oauth2 (version 1.13.2 - binary used, no package install) and OpenVPN 2.6.5 server:
time=2024-01-05T23:15:28.522Z level=INFO msg="new client connection" cid=3 kid=1 common_name="" reason=CONNECT username=""
time=2024-01-05T23:15:28.523Z level=INFO msg="start pending auth" cid=3 kid=1 common_name="" reason=CONNECT username=""
time=2024-01-05T23:15:28.744Z level=INFO msg="initialize authorization via oauth2" cid=3 kid=1 common_name=""
time=2024-01-05T23:15:28.980Z level=WARN msg="Unauthorized: failed to get state: http: named cookie not present"
time=2024-01-05T23:15:28.980Z level=ERROR msg="http: superfluous response.WriteHeader call from github.com/jkroepke/openvpn-auth-oauth2/internal/oauth2.writeError (handler.go:244)"

2024-01-05 23:15:28 us=512342 Connection Attempt MULTI: multi_create_instance called
2024-01-05 23:15:28 us=513065 <IP_ADDRESS>:52369 Re-using SSL/TLS context
2024-01-05 23:15:28 us=513141 <IP_ADDRESS>:52369 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
2024-01-05 23:15:28 us=513157 <IP_ADDRESS>:52369 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
2024-01-05 23:15:28 us=513458 <IP_ADDRESS>:52369 Control Channel MTU parms [ mss_fix:0 max_frag:0 tun_mtu:1250 tun_max_mtu:0 headroom:126 payload:1600 tailroom:126 ET:0 ]
2024-01-05 23:15:28 us=513474 <IP_ADDRESS>:52369 Data Channel MTU parms [ mss_fix:0 max_frag:0 tun_mtu:1500 tun_max_mtu:1600 headroom:136 payload:1768 tailroom:562 ET:0 ]
2024-01-05 23:15:28 us=521467 <IP_ADDRESS>:52369 peer info: IV_VER=3.git::d3f8b18b
2024-01-05 23:15:28 us=521491 <IP_ADDRESS>:52369 peer info: IV_PLAT=win
2024-01-05 23:15:28 us=521517 <IP_ADDRESS>:52369 peer info: IV_NCP=2
2024-01-05 23:15:28 us=521524 <IP_ADDRESS>:52369 peer info: IV_TCPNL=1
2024-01-05 23:15:28 us=521531 <IP_ADDRESS>:52369 peer info: IV_PROTO=30
2024-01-05 23:15:28 us=521544 <IP_ADDRESS>:52369 peer info: IV_CIPHERS=AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305:BF-CBC
2024-01-05 23:15:28 us=521551 <IP_ADDRESS>:52369 peer info: IV_IPv6=0
2024-01-05 23:15:28 us=521558 <IP_ADDRESS>:52369 peer info: IV_AUTO_SESS=1
2024-01-05 23:15:28 us=521566 <IP_ADDRESS>:52369 peer info: IV_GUI_VER=OCWindows_3.3.6-2752
2024-01-05 23:15:28 us=521574 <IP_ADDRESS>:52369 peer info: IV_SSO=webauth,openurl,crtext
2024-01-05 23:15:28 us=521605 <IP_ADDRESS>:52369 peer info: IV_BS64DL=1
2024-01-05 23:15:28 us=521677 <IP_ADDRESS>:52369 TLS: Username/Password authentication deferred for username ''
2024-01-05 23:15:28 us=521769 <IP_ADDRESS>:52369 TLS: move_session: dest=TM_ACTIVE src=TM_INITIAL reinit_src=1
2024-01-05 23:15:28 us=521824 <IP_ADDRESS>:52369 TLS: tls_multi_process: initial untrusted session promoted to semi-trusted
2024-01-05 23:15:28 us=523273 MANAGEMENT: CMD 'client-pending-auth 3 1 "WEB_AUTH::https://ovpn-auth.company.io/oauth2/start?state=MeVQ3HXRlmhx51g0T8hZVPrj7OvBGk1UPEWEnmQdZ8H0rhDuLv9BGi9ZFLZEeCnJ" 180'
2024-01-05 23:15:28 us=523428 SENT CONTROL []: 'AUTH_PENDING,timeout 180' (status=1)
2024-01-05 23:15:28 us=523443 SENT CONTROL []: 'INFO_PRE,WEB_AUTH::https://ovpn-auth.company.io/oauth2/start?state=MeVQ3HXRlmhx51g0T8hZVPrj7OvBGk1UPEWEnmQdZ8H0rhDuLv9BGi9ZFLZEeCnJ' (status=1)
2024-01-05 23:15:28 us=527422 <IP_ADDRESS>:52369 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384
2024-01-05 23:15:28 us=527493 <IP_ADDRESS>:52369 [] Peer Connection Initiated with [AF_INET]<IP_ADDRESS>:52369
2024-01-05 23:15:28 us=527806 <IP_ADDRESS>:52369 PUSH: Received control message: 'PUSH_REQUEST'

Related lines from server config:
verify-client-cert none
auth-user-pass-optional
management <IP_ADDRESS> 5000 /etc/openvpn/password.txt
management-client-auth

These env variables are set:
  CONFIG_HTTP_BASEURL
  CONFIG_HTTP_LISTEN
  CONFIG_HTTP_SECRET
  CONFIG_OPENVPN_ADDR
  CONFIG_OPENVPN_PASSWORD
  CONFIG_OAUTH2_ISSUER
  CONFIG_OAUTH2_SCOPES
  CONFIG_OAUTH2_CLIENT_ID
  CONFIG_OAUTH2_CLIENT_SECRET
  CONFIG_OAUTH2_REFRESH_ENABLED
  CONFIG_OAUTH2_REFRESH_EXPIRES
  CONFIG_OAUTH2_REFRESH_SECRET

Screenshots from the browser:

Could it be caused by wrong cookie path?

Tried with 1.13.1 and it works :)

@RichardSufliarsky the error you mention should fixed in #112. I implement some tests for cookie behavior and saw some additional errors. 1.13.3 should also works for you.

@jkroepke thank you very much, 1.13.3 works for me.


Fixed initializer issue

If the optionals alertAction and soundName weren't set, the init function would return nil unexpectedly

Would you please provide a test unit that fails having them not set?

Sure will look into it and reopen


Is there any plan to add feature for video resize

Really a nice package.
It would be better if we add functionality to do resize of video dimensions.
Is there any plan!?

You are welcome to try my PR and comment:
Link

You can try this feature on the latest master:
video_compress:
  git:
    url: https://github.com/jonataslaw/VideoCompress
    ref: "583e700"

use this
MediaInfo mediaInfo = await VideoCompress.compressVideo(
      result.files.single.path,
      quality: VideoQuality.LowQuality,
      deleteOrigin: false, // It's false by default
  );


sync with upstream

woops created by mistake

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 93.056%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
1434

Relevant Lines:
1541

💛  - Coveralls


Locale bug when using nouislider in SurveyJS builder

In SurveyJS builder; add a new nouislider to your survey.
Select it, on the right hit "edit" from "pipsValues". In the popup add some value/text items. All fine.
Verify the "pipsValues" options are stored in the JSON by clicking JSON editor.
Now in the survey properties; hit locale and change to another language.
Verify the  "pipsValues" options are lost.
You have to start over and dont change the language.

I've fixed the issue (actually there was an issue in SurveyJS core library)
Fix will be available in the nearest update

Just for memory - plunker to check and play with - https://plnkr.co/edit/HxSI1vTcoOp9piCGtyDt?p=preview

I cannot play with the plunker, for sure beause the .js is 404: https://surveyjs.azureedge.net/1.0.50/survey.ko.js

@lukasmedia Absolutely right - I leaved this link here "Just for memory" and "Fix will be available in the nearest update"
Sorry for misunderstanding

Just tested with https://surveyjs.azureedge.net/1.0.52/surveyeditor.js and no improvement, but things got worst: when i switch to json / designer the all values are lost.

Yes. The bug is not fixed yet. We're working on the fix. Once it will be fixed we'll update this thread.
Sorry for possible inconvinience.

@lukasmedia We've fixed the bug.
Please check the example with a new library build: https://plnkr.co/edit/4BPtn4ssKvq46C4we5SV?p=preview
Fix will be available in the next minor update.