PZPlanet Zoo
Created by Wildcards on 5/8/2025 in #help-discussion
Looking for Sow-rocks and trees
Hello, anyone knows, where i can find these snow stones and trees from this video? https://www.youtube.com/watch?v=ASUFsMdLH44
31 replies
BBuildShip
Created by Oct on 5/8/2025 in #❓・buildship-help
:rotating_light:Business Partner Opportunity for Profitable Venture:rotating_light:
Hello! I'm looking for a reliable business partner to collaborate on a profitable venture. With my expertise in software engineering, I believe we can combine our strengths to achieve substantial success. Ideal Partner Qualities: - 20+ years old - Based in the US, UK, Canada, Australia, or the EU - Basic understanding of computer science (preferred but not required) - Strong communication skills in English - Compensation: $4,000 - $5,000 per month If you're interested or know someone who would be, please reach out! I'll be happy to provide more details. Looking forward to connecting!
4 replies
BABetter Auth
Created by karlito1501 on 5/8/2025 in #help
How to have databaseHooks event whenever user logs in?
This is my auth code. My goal is to save the date when user logged in.
import { betterAuth } from "better-auth";
import { MongoClient } from "mongodb";
import { mongodbAdapter } from "better-auth/adapters/mongodb";
import { admin } from "better-auth/plugins"
import Logins from "@/models/Logins";


const client = new MongoClient(process.env.MONGO_URI || "");
const db = client.db();

export const auth = betterAuth({
database: mongodbAdapter(db),
emailAndPassword: {
enabled: true
},
plugins: [
admin(),
],
user: {
additionalFields: {
purchases: {
type: "string[]",
defaultValue: [],
}
}
},
databaseHooks: {
user: {
update: {
after: async (user, ctx) => {
const id = user.id
const ip = ctx?.request?.headers.get("x-forwarded-for") || ctx?.request?.headers.get("remote-addr")
try {
const newLogin = await Logins.create({
userId: id,
ip: ip,
});
if (newLogin) {
console.log("Login saved successfully:", newLogin);
}

} catch (error) {
console.error("Error saving login:", error);

}

},
},
}
}
});
import { betterAuth } from "better-auth";
import { MongoClient } from "mongodb";
import { mongodbAdapter } from "better-auth/adapters/mongodb";
import { admin } from "better-auth/plugins"
import Logins from "@/models/Logins";


const client = new MongoClient(process.env.MONGO_URI || "");
const db = client.db();

export const auth = betterAuth({
database: mongodbAdapter(db),
emailAndPassword: {
enabled: true
},
plugins: [
admin(),
],
user: {
additionalFields: {
purchases: {
type: "string[]",
defaultValue: [],
}
}
},
databaseHooks: {
user: {
update: {
after: async (user, ctx) => {
const id = user.id
const ip = ctx?.request?.headers.get("x-forwarded-for") || ctx?.request?.headers.get("remote-addr")
try {
const newLogin = await Logins.create({
userId: id,
ip: ip,
});
if (newLogin) {
console.log("Login saved successfully:", newLogin);
}

} catch (error) {
console.error("Error saving login:", error);

}

},
},
}
}
});
3 replies
DHDistant Horizons
Created by bros peenar 1 on 5/8/2025 in #help-me
the LOD is going past my render distance
No description
9 replies
KPCKevin Powell - Community
Created by Faker on 5/8/2025 in #help
How does ".vtt" file work?
Hello guys, I was reading a bit about videos and audios on MDN and came across ".vtt" file extensions. I'm a bit confused about that, how does it work? Do we take, say an audio then change its file extension to .vtt?
2 replies
FFilament
Created by Kaesa Lyrih on 5/8/2025 in #❓┊help
Where to Inject a Custom Action in Filament EditPage After Policy and Validation Are Passed?
Hi everyone! 👋 I'm currently building a custom UpdateUserAction and would like to integrate it properly into a Filament EditRecord page. --- My Goal: I want to run a custom action (e.g., UpdateUserAction) only after: 1. Policy Authorization has passed (can:update on the model) 2. Validation has been successfully performed using the form schema 3. Data has been potentially transformed (if needed) --- 🤔 My Main Question: Which method inside the EditRecord or EditUser page is best for injecting a custom action after authorization and validation have passed? I want to avoid doing policy or validation inside the action itself — my goal is to delegate those responsibilities to Filament’s internal authorization and validation flow, and only call the action after that. For example:
protected function handleRecordUpdate(Model $record, array $data, UpdateUserAction $action): Model
{
// This seems like the correct place?
return $action->handle($record, $data); // Return User Model
}
protected function handleRecordUpdate(Model $record, array $data, UpdateUserAction $action): Model
{
// This seems like the correct place?
return $action->handle($record, $data); // Return User Model
}
Is handleRecordUpdate() guaranteed to run only after policy and validation have passed? If not, is there a more appropriate method to override? --- 🛠️ Context: I want to avoid calling FormRequest manually inside this method — I'd rather lean on Filament’s built-in validation and authorization mechanisms that already wrap around the EditPage lifecycle. --- 🙏 What I'm Looking For: * Confirmation that handleRecordUpdate() is the right place to inject my custom action. * If not, what would be the best method/hook to override? * Any example of delegating business logic into an action after Filament’s validation/policy pipeline. Thanks in advance for your help! I’d love to make this pattern as clean and idiomatic as possible with Filament. 🔧
2 replies
TTCTheo's Typesafe Cult
Created by DZΞKI on 5/8/2025 in #questions
A simple plan to increase your userbase and profits while benefitting users as well
No description
2 replies
BABetter Auth
Created by Filippo on 5/8/2025 in #help
List sessions server side
Hello, I'm making a sveltekit app where after the login input, if credentials are right, the server look for other sessions of the user, if there is another session open (for example in another device's browser) there is a modal that asks for session removal (it's a web app and I need to limit multiple sessions) then the log in proceeds. Is there a way to use authClient.listSessions() on the server? Because I could login the user before and then prompt the session and log out if the other is not removed, but it looks more prone to exploits and I'd prefer server-side operations.
2 replies
BABetter Auth
Created by Bruh on 5/8/2025 in #help
Database Hooks `before.create` Has Undefined Context
How is the context populated in the database before create hook? Taken from example here https://www.better-auth.com/docs/concepts/database#1-before-hook Code snippet below:
databaseHooks: {
session: {
create: {
before: async (session, context) => {
// context is always undefined here

return {
data: session
}
},
}
}
},
databaseHooks: {
session: {
create: {
before: async (session, context) => {
// context is always undefined here

return {
data: session
}
},
}
}
},
5 replies
DDeno
Created by vwkd on 5/8/2025 in #help
Lock file in JSR library?
Should one use a lock file in a JSR library or not? If not, should one put it in .gitignore or rather set lock: false in deno.json?
2 replies
TtRPC
Created by pes04 on 5/8/2025 in #❓-help
Question about onError and modifying error messages in tRPC
I’m trying to follow the tRPC docs on error handling and want to log detailed errors on the server by throwing specific exceptions but send a generic message to the client (see https://trpc.io/docs/server/error-handling#handling-errors). I thought this would work:
onError: (opts) => {
logError(`Error in TRPC in path=${opts.path}`, opts.error);

opts.error = new TRPCError({
code: 'INTERNAL_SERVER_ERROR',
message: 'An error happened. Please try again',
});
}
onError: (opts) => {
logError(`Error in TRPC in path=${opts.path}`, opts.error);

opts.error = new TRPCError({
code: 'INTERNAL_SERVER_ERROR',
message: 'An error happened. Please try again',
});
}
But it doesn’t seem to have any effect — the original error is still sent to the client. According to the docs, I assumed mutating opts.error would override the one sent to the client. Am I misunderstanding something, or is there another way to do this? Thanks in advance.
3 replies
CC#
Created by dvdmeer on 5/8/2025 in #help
Data seeding with anonymous objects in .NET 9
I recently began migrating some projects from .NET 8 to .NET 9. One of the things I now run into is the Seeding part with Entity Framework Core. My seeding in my projects is done in the OnModelCreating and I add an extra environment variable to ensure that this part does not happen all the time. I then use something like:
modelBuilder.Entity<MyDtoClass>().HasData(
new
{
...
});
modelBuilder.Entity<MyDtoClass>().HasData(
new
{
...
});

The reason I am using anonymous objects is that I make use of shadow properties for several objects and I fill these properties in my override of SaveChangesAsync. This way I just just add a couple of marker classes to some of my DTO objects like ICreateable, IUpdateable or ISoftDeletable and then these shadow properties are automatically filled when required. For Seeding my data I generate certain information dynamically (e.g. GUIDs and dates/times) which has not been a problem in .NET 8 but I do turn off the warning I get:
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.ConfigureWarnings(warnings => warnings.Ignore(RelationalEventId.PendingModelChangesWarning));
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.ConfigureWarnings(warnings => warnings.Ignore(RelationalEventId.PendingModelChangesWarning));
}
Now with .NET 9 there is a new way of seeding data. So, the data seeding happens somewhere else. The example Microsoft gives is at: https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-9.0/whatsnew#improved-data-seeding
context.Set<Blog>().Add(new Blog { Url = "http://test.com/" });
context.SaveChanges();
context.Set<Blog>().Add(new Blog { Url = "http://test.com/" });
context.SaveChanges();
Unfortunately by using this context.Set<T>().Add method I am no longer able to add an anonymous object so it now becomes impossible for me to use with the shadow properties as they are not defined for my DTOs. How can I handle this scenario without going back to the old way?
1 replies
JCHJava Community | Help. Code. Learn.
Created by Blu_One on 5/8/2025 in #java-help
I cannot run Springboot backend.
Springboot:2.7.18 Java:17 Gradle:7.3.3 I tried to run the backend using gradle bootRun but got this error.
> Task :bootRun FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootRun'.
> Process 'command 'C:\Program Files\Java\jdk-17\bin\java.exe'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 6s
4 actionable tasks: 2 executed, 2 up-to-date
> Task :bootRun FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootRun'.
> Process 'command 'C:\Program Files\Java\jdk-17\bin\java.exe'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 6s
4 actionable tasks: 2 executed, 2 up-to-date
Surprisingly, building went smoothly without any issues. Hope your help!!
4 replies
DDeno
Created by staytuned_team on 5/8/2025 in #help
Support for tags in custom Deno lint plugins
Hi everyone! I’m working on a custom Deno lint plugin that currently defines about ten rules. I’d like to be able to group those rules into named “tags” (for example, frontend, backend, performance, etc.) so that in one project I can enable only the rules tagged frontend and in another project only those tagged backend. Right now, Deno’s built-in lint rules support tagging and allow you to enable or disable rules by tag, but custom plugins don’t expose that same functionality. Would it be possible to add tag support for custom lint plugins so we can define and consume tags just like the built-in rules? Any guidance on how to implement this or interest in adding it to the core would be greatly appreciated thanks!
1 replies
XXata
Created by Michael Schaufelberger on 5/8/2025 in #help
Unable to start a pgroll migration using the Xata CLI
Hi 👋 I'm having trouble starting a pgroll v0.11.1 migration using the Xata CLI. The error I get is: xata migrate start mybranch db/migrations/pgroll/0000_init.json
Error: invalid migration: decode migration [create_table]: json: unknown field "constraints"
Error: invalid migration: decode migration [create_table]: json: unknown field "constraints"
I suspect that has to do with the Xata CLI not supporting the newest migration syntax of pgroll. What can I do to work around this issue? Can I use pgroll directly?
5 replies
TTCTheo's Typesafe Cult
Created by Nat85 on 5/8/2025 in #questions
DnD Kit
Anyone here have experience with DND Kit that may be able to help me solve a bug? The issue is on click events not working properly. If anyone does have experience with dnd kit and can help I would really appreciate that!
2 replies
FFilament
Created by Urbanist on 5/8/2025 in #❓┊help
Variable inside forms Action->action are stuck to first iteration, when I'm creating it in foreach
No description
8 replies